Invalid Descriptor Index

I am using MS Sql Server 2000. I am getting following error while trying to retrieve records.
javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
     org.apache.jsp.modiimptrans_jsp._jspService(modiimptrans_jsp.java:126)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
     sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
     sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
     sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3908)
     sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5699)
     sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353)
     sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:410)
     org.apache.jsp.modiimptrans_jsp._jspService(modiimptrans_jsp.java:77)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

Gave up to use odbc jdbc bridge driver for MS SQLServer. Then try:
http://jtds.sourceforge.net/
or
http://www.microsoft.com/downloads/details.aspx?FamilyID=4F8F2F01-1ED7-4C4D-8F7B-3D47969E66AE&displaylang=en
Then your issue should disappear.

Similar Messages

  • Invalid descriptor index error

    hai...
    i am having this error..
    java.sql.SQLException:[Microsoft][ODBC Microsoft Access Driver]invalid descriptor index.
    I am doing RMI application..while i am trying to insert i got this error...
    here i paste my code....can anyone help me in finding out error.please...
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection("jdbc:odbc:bnk11","","");
    Statement max = conn.createStatement();
    rs1 = max.executeQuery("Select max(AccountNo) from Customer");
    rs1.next();
    String maxValue = rs1.getString(1);
    int maxx = Integer.parseInt(maxValue);
    int max1 = maxx+2;
    max2 = Integer.toString(max1);
    Statement pin = conn.createStatement();
    rs2 = max.executeQuery("Select max(PinNo) from Customer");
    rs2.next();
    String maxValue1 = rs2.getString(2);
    int pinmaxx = Integer.parseInt(maxValue1);
    int pinmax1 = pinmaxx+3;
    String pinmax2 = Integer.toString(pinmax1);
    Statement sm=conn.createStatement();
    rs=sm.executeQuery("Select * from Customer");     
    sm.executeUpdate("insert into Customer values('"+max2+"','"+pinmax2+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"','"+h+"','"+i+"')");
    conn.close();
    Thanks in advance...

    In future when you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    The error is happening here
    rs2 = max.executeQuery("Select max(PinNo) from Customer");
    rs2.next();
    String maxValue1 = rs2.getString(2); // WRONG!You can't get the second column (2). There is only one column in that result set. It should be getXXX(1)
    And that's another thing. What in the holy hell are you doing here?
    String maxValue = rs1.getString(1);
    int maxx = Integer.parseInt(maxValue);
    int max1 = maxx+2;Sillyness.
    int max1 = rs1.getInt(1)+2;Finally you should look into using PreparedStatements. http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

  • Database Connector Error: '07009:[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index'

    <p>I&#39;m getting the following error:</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Database Connector Error: &#39;07009:[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index&#39;</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal">&#160;</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="times new roman,times" size="2">when trying to run a report in Crystal 11 (inside of Crystal Report Designer 11)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal">&#160;</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="times new roman,times" size="2">Please help!!!!!</font></p>

    duplicate - please do not post multiple times

  • Invalid Descriptor Index - darn SQL2000

    I'd like to first off say that I would much rather be using MySQL than SQL2000 but I have no choice. My boss is a Microsoft freak. eeuuuwww!!!
    Ok, my question. I have a table with approx 150 fields and I get an Invalid Descriptor Index when I use "SELECT * FROM". I know that the reason is because I have to list every field in the order of return but there are so many and if they are null then they are not displayed (thanx dreamweaver).
    When I run the query off the SQL2000 manager, it works without a problem.
    Is there a way to get this to work without typing out all 150 fields?
    Thanx,
    Philip

    I'd like to first off say that I would much rather be
    using MySQL than SQL2000 but I have no choice. My
    boss is a Microsoft freak. eeuuuwww!!!
    And apparently you (or perhaps even your boss) does not understand the power of stored procedures, triggers, etc.
    >
    Ok, my question. I have a table with approx 150
    fields and I get an Invalid Descriptor Index when I
    use "SELECT * FROM". I know that the reason is
    because I have to list every field in the order of
    return but there are so many and if they are null then
    they are not displayed (thanx dreamweaver).
    When I run the query off the SQL2000 manager, it works
    without a problem.
    Is there a way to get this to work without typing
    out all 150 fields? Well you would never 'type' them out anyways. You would simply use Enterprise Manager to export the schema and then just use that when building the select.
    Of course I would guess something is seriously wrong when you need to access 150 fields in the first place. Not to mention if they are in a single table.

  • Sybase ASE 15.7.103 ODBC Driver invalid descriptor index

    Hey guys,
    after migration from oracle nuc to sybase ase 15.7.101 unicode and implementation of sapnote 1558958 (dbacockpit collection for NW 702) there were everything which was in dbacockpit displayed ok.
    After upgrade to patch 103 theres a problem in the dbacockpit. I will show in the register Database SID - Space - Tables and Indices - Tables.
    After I select this. There comes follwing error: ASE Error SQL30013:07009][SAP][ASE ODBC Driver]Invalid descriptor index.
    In error details I see SQLCode 30013
    The Database ist open and there are no other kown problems with connection. SAP could establish connection to sybase ase database and users can work normally.
    In the dbacockpit Database SID - Space - Devices and Databases are shown without problems.
    message details:
    Exception CX_DBA_ADBC in class CL_SYB_RDI_QUERY method GET_TABLES_SPACE line 217
    Kernel Error ID:
    WP ID: 4
    WP PID: 4272
    SYSID: SE1
    SY-SUBRC: 0
    SQL statement: SELECT TOP 50 DBNAME, USER_NAME AS TABOWNER, TAB_NAME AS TABNAME, ' ' AS PARTITIONNAME, 0 AS ID, 0 AS PARTITIONID, ' ' AS SNAPSHOT_TIMESTAMP, ' ' AS TIMESTAMP_FROM, ' ' AS TIMESTAMP_TO, SUM(TIME_PERIOD) AS TIME_PERIOD, AVG(ROW_COUNT) AS ROW_COUNT, MAX(ROW_COUNT) AS ROW_COUNT_MAX, AVG(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB, MAX(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB_MAX, AVG(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB, MAX(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB_MAX, AVG(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB, MAX(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB_MAX, AVG(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB, MAX(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB_MAX, AVG(TAB_DATAPGCLRATIO)*100 AS TAB_DATAPGCLRATIO, MIN(TAB_DATAPGCLRATIO)*100 AS TAB_DATAPGCLRATIO_MIN, AVG(TAB_LRGIOEFF)*100 AS TAB_LRGIOEFF, MIN(TAB_LRGIOEFF)*100 AS TAB_LRGIOEFF_MIN, AVG(DATACHANGE) AS DATACHANGE, MAX(DATACHANGE) AS DATACHANGE_MAX, AVG(forwrowcnt) AS forwrowcnt, MAX(forwrowcnt) AS forwrowcnt_MAX, AVG(delrowcnt) AS delrowcnt, MAX(delrowcnt) AS delrowcnt_MAX, AVG(extent0pgcnt) AS extent0pgcnt, MAX(extent0pgcnt) AS extent0pgcnt_MAX, AVG(oamapgcnt) AS oamapgcnt, MAX(oamapgcnt) AS oamapgcnt_MAX, AVG(oampagecnt) AS oampagecnt, MAX(oampagecnt) AS oampagecnt_MAX, MAX(str_replace(str_replace(str_replace(convert(VARCHAR(19),statmoddate,23),':',NULL),'-',NULL),'T',NULL)) AS statmoddate, AVG(datarowsize) AS datarowsize, MAX(datarowsize) AS datarowsize_MAX, AVG(TAB_DATA_TOTAL_KB) AS TAB_DATA_TOTAL_KB, MAX(TAB_DATA_TOTAL_KB) AS TAB_DATA_TOTAL_KB_MAX, AVG(TAB_DATA_UTL_TOTAL_KB) AS TAB_DATA_UTL_TOTAL_KB, MAX(TAB_DATA_UTL_TOTAL_KB) AS TAB_DATA_UTL_TOTAL_KB_MAX, AVG(TAB_USED_TOTAL_KB) AS TAB_USED_TOTAL_KB, MAX(TAB_USED_TOTAL_KB) AS TAB_USED_TOTAL_KB_MAX, AVG(TAB_RESERVED_TOTAL_KB) AS TAB_RESERVED_TOTAL_KB, MAX(TAB_RESERVED_TOTAL_KB) AS TAB_RESERVED_TOTAL_KB_MAX, AVG(TAB_UNUSED_TOTAL_KB) AS TAB_UNUSED_TOTAL_KB, MAX(TAB_UNUSED_TOTAL_KB) AS TAB_UNUSED_TOTAL_KB_MAX FROM ( SELECT DBNAME, USER_NAME, TAB_NAME, SNAPSHOT_TIMESTAMP AS SNAPSHOT_TIMESTAMP, SUM(TIME_PERIOD) AS TIME_PERIOD, SUM(ROW_COUNT) AS ROW_COUNT, SUM(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB, SUM(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB, SUM(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB, SUM(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*TAB_DATAPGCLRATIO) / SUM(ROW_COUNT) ELSE 1 END AS TAB_DATAPGCLRATIO, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*TAB_LRGIOEFF) / SUM(ROW_COUNT) ELSE 1 END AS TAB_LRGIOEFF, CASE WHEN SUM(ROW_COUNT+delrowcnt) > 0 THEN SUM((ROW_COUNT+delrowcnt)*DATACHANGE) / SUM(ROW_COUNT+delrowcnt) ELSE 0 END AS DATACHANGE, SUM(forwrowcnt) AS forwrowcnt, SUM(delrowcnt) AS delrowcnt, SUM(extent0pgcnt) AS extent0pgcnt, SUM(oamapgcnt) AS oamapgcnt, SUM(oampagecnt) AS oampagecnt, MAX(statmoddate) AS statmoddate, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*datarowsize) / SUM(ROW_COUNT) ELSE 0 END AS datarowsize, SUM(TAB_DATA_KB+TAB_DATA_LOB_KB) AS TAB_DATA_TOTAL_KB, SUM(TAB_DATA_UTL_KB+TAB_DATA_LOB_KB) AS TAB_DATA_UTL_TOTAL_KB, SUM(TAB_USED_KB+TAB_USED_LOB_KB) AS TAB_USED_TOTAL_KB, SUM(TAB_RESERVED_KB+TAB_RESERVED_LOB_KB) AS TAB_RESERVED_TOTAL_KB, SUM((TAB_RESERVED_KB+TAB_RESERVED_LOB_KB) - (TAB_USED_KB+TAB_USED_LOB_KB)) AS TAB_UNUSED_TOTAL_KB FROM saptools..DBH_STG_TABLES WHERE SNAPSHOT_TIMESTAMP >= dateadd(ss,TIME_PERIOD,?) AND SNAPSHOT_TIMESTAMP <= dateadd(ss,5,?) AND BDOP = 1 AND BDOI = 0 GROUP BY DBNAME, USER_NAME, TAB_NAME, SNAPSHOT_TIMESTAMP ) AS STD_AGGR GROUP BY DBNAME, USER_NAME, TAB_NAME ORDER BY TAB_RESERVED_TOTAL_KB DESC AT ISOLATION READ UNCOMMITTED
    Database: +++SYBADM
    caused by
    Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    Kernel Error ID:
    DB Error: Yes
    SQL Code: 30013
    SQL Message: [ASE Error SQL30013:07009][SAP][ASE ODBC Driver]Invalid descriptor index
    DB Object Exists: No
    Duplicated Key: No
    Internal Error: 1
    Invalid Cursor: No
    Unknown Connection: No
    Connection Closed: No

    Thanks Mr Model-Bosch,
    we have installed the latest dbsl Patch 213. And we have installed the Patch Collection twice as described in SAP Note 1558958.
    So I have to wait. I hope my SAP Message will be edited soon.

  • Invalid Descriptor Index problem

    I'm accessing a SQL Server 7 DB and when i attempt to display an integer with 'rs.getString("newsId")' I get an - 'Invalid Descriptor Index' error on the page. I also tried getInt and getLong, but nothing seems to work. The code works with no errors when i connect to a MS Access DB. Any ideas?

    I just found my answer. I noticed a post where the person switched the variables to the order in which they were in the DB and it worked.
    Thanks anyway.

  • Strange - Invalid Descriptor Index

    Hello everyone,
    When I run the following code I get an Invalid Descriptor Index.
    //////////////////CODE////////////
    Object answer = JOptionPane.showInputDialog(this, "Enter Employee Name", "Search Records", JOptionPane.OK_CANCEL_OPTION);
    String query = ("SELECT * FROM tblEmployee WHERE employeeName = " + "'" + answer.toString() + "'");
    results = stmt.executeQuery(query);
    tfModField1.setText(results.getString(0));
    tfModField2.setText(results.getString(1));
    tfModField3.setText(results.getString(2));
    tfModField4.setText(results.getString(3));
    tfModField5.setText(results.getString(4));
    I know this error is usually caused by trying to use the columns in a different order than they were called by the query, but how does this apply when you want to select all of the columns? If anyone can help with this I would greatly appreciate it.
    Regards,
    Michael Finley

    I have also tried the following, which generates an Invalid Cursor State error
    //////////CODE/////////
              Object answer = JOptionPane.showInputDialog(this, "Enter Employee Name", "Search Records", JOptionPane.OK_CANCEL_OPTION);     
              String query = ("SELECT employeeName, employeePW, employeeSecurity, employeeTickets, employeeStatus FROM tblEmployee WHERE employeeName = " + "'" + answer.toString() + "'");
              JOptionPane.showMessageDialog(this, query);
              results = stmt.executeQuery(query);     
    tfModField1.setText(results.getString("employeeName"));
              tfModField2.setText(results.getString("employeePW"));
              tfModField3.setText(results.getString("employeeSecurity"));
              tfModField4.setText(results.getString("employeeTickets"));
              tfModField5.setText(results.getString("employeeStatus"));
    Again, I'm stumped.
    Regards,
    Mike Finley

  • Invalid Descriptor Index (SQL exception)

    Hi Defts,
    im developing an application using swings, im getting an Invalid Descriptor Index (SQL exception). I have given my code below kindly help me out.
    private void formWindowActivated(java.awt.event.WindowEvent evt) {                                    
    // TODO add your handling code here:
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbc");
    Connection con = DriverManager.getConnection("jdbc:odbc:tourismdatasource", "sa", "");
    String sel= "select * from tab_places where place_ID=?";
    PreparedStatement ps=con.prepareStatement(sel);
    ps.setString(1, jTextField4.getText().toString().trim());
    ResultSet rs=ps.executeQuery();
    if(rs.next())
    jTextField1.setText(rs.getString("place_name").toString());
    jTextField2.setText(rs.getString("state").toString());
    jTextField3.setText(rs.getString("category").toString());
    jTextArea1.setText(rs.getString("place_des").toString());
    catch(SQLException se){JOptionPane.showMessageDialog(null, se.getMessage());}
    catch(ClassNotFoundException ce){JOptionPane.showMessageDialog(null, ce.getMessage());}
    }

    It would help to know what statement is throwing the exception. The stack trace tells you that.
    As a guess the "select *" is returning the columns in a specific order. You are not calling getString() in that order though.
    Or one of the getString() values is wrong.
    And get rid of the ToString() calls on the getString() methods - they are already strings.

  • Get  INvalid descriptor index

    i used the following in my code. compiles ok but give a
    Invalid Descriptor Index
    when i try to run this. why? isn't the index automatic?
    if not how can i get this index?
    while(res.next()) {
    tour = res.getString(1) + " TO " + res.getString(2);
    pls advise

    I agree that the original SQL returned a single column.
    Try this:
    "SELECT
                COLUMN2NAME,
                COLUMN3NAME,
                COLUMN6NAME,
                MAX(RANK)
    FROM
                MON1
    WHERE
                FROMNODE = " + from +
    "           AND PICK = 0
    GROUP BY
                COLUMN2NAME,
                COLUMN3NAME,
                COLUMN6NAME"            You'll use res.getString(1) to get COLUMN2NAME
    You'll use res.getString(2) to get COLUMN3NAME
    Since you are using a Access database, try getting the SQL statement to work in Access. Once the query works in Access, you can copy it over to Java.

  • Getting Invalid Descriptor Index (SQL ERROR) ERROR

    Hi,
    When i am running this java class then i am fetiching all the values from database table to the CSV file then i am getting the following database error.
    import java.io.FileWriter; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import com.fidelity.ftg.ereviewg2.migration.connection.DatabaseConnection; import com.fidelity.ftg.ereviewg2.migration.vo.object.DmUserVO; import com.fidelity.ftg.ereviewg2.migration.vo.table.Iereview.ITMigFilenetAttachErrorVO; /** * @Organization: Fidelity Investments/FTG * @Project: eReview_DataConversion * @File: DatabseFetching.java * @Description: * @date: Oct 28, 2008 * @author: 197881 **/ /** * @author 197881 * */ public class DatabseFetching { /** * @param args */ public static void main(String[] args) throws SQLException, Exception { // TODO Auto-generated method stub DatabaseConnection con = new DatabaseConnection(); Connection connection = con.getConnection(); String AttachId=null; StringBuffer buffer = new StringBuffer(); String tMigFilenetAttachErrorColumnName[] = { ITMigFilenetAttachErrorVO.PIECE_ID, ITMigFilenetAttachErrorVO.PIECE_NUM, ITMigFilenetAttachErrorVO.PIECE_VER, ITMigFilenetAttachErrorVO.PIECE_INSTANCE, ITMigFilenetAttachErrorVO.ATTACH_ID, ITMigFilenetAttachErrorVO.ERROR_CD, ITMigFilenetAttachErrorVO.ERROR_REASON }; FileWriter createCsvFileObj = new FileWriter("D:/TCS/1.csv"); String SQL = "select * from t_mig_filenet_attach_error"; Statement stmt = connection.createStatement(); ResultSet resultObj = stmt.executeQuery(SQL); while (resultObj.next()) { AttachId=resultObj.getString("attach_id"); if(AttachId.equals("attacha")) { System.out.println("attach id is"+AttachId); for (int i = 0; i < tMigFilenetAttachErrorColumnName.length; i++) { buffer.append(resultObj.getString(tMigFilenetAttachErrorColumnName));
    buffer.append(",");
    buffer.append("falure");
    buffer.append("\n");
    createCsvFileObj.write(buffer.toString());
    createCsvFileObj.close();
    *{color:#ff0000}********************ERROR*************************{color}* *{color:#ff0000}{color:#000000}# Connected to Database: sun.jdbc.odbc.JdbcOdbcConnection@a62fc3* *attach id isattacha* *{color}Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index* * at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)* * at DatabseFetching.main(DatabseFetching.java:58){color}*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    The columns from the ResultSet must be retrieved in the order in which they appear in the table. Say your table has columns Name, Address, City. Then you should retrieve them as:
    ResultSet.getString("Name");
    ResultSet.getString("Address");
    ResultSet.getString("City");
    Otherwise you will get an Invalid Descriptor Index.
    Like this:
    ResultSet.getString("Address");
    ResultSet.getString("Name");
    ResultSet.getString("City");
    Invalid Descriptor Index

  • Invalid Descriptor Index After First Record

                   recordCount = 1;
                   if(rs != null)
                        rs.last();
                        totalRows = rs.getRow();
                        rs.first();
                        System.out.println("Total Rows: "+totalRows);
                   if (rs != null) while ( rs.next() )
                        hasResults = true;
                        for(rowCount = 0; rowCount < totalRows; rowCount++)
                             for(columnCount = 0; columnCount < 9; columnCount++)
                                  SearchMenu.fieldArray[rowCount][columnCount].setText(rs.getString(recordCount));
                                  recordCount++;
                        }I am using the above code to read and display data in a 20 row 9 column array of text fields. The database has 9 columns. The first record in a query is displaying correctly, but then I get Invalid Descriptor Index (and no more records are displayed). Can anyone help? Thanks a bunch.

    I went ahead and tried resetting the recordCount to 1
    after each row like you suggested, but that produced
    the same error and problem. Then you have another problem. But I doubt this is happening.
    It is my understanding
    that the first object in the resultset's second row
    is one past the last object of the first row, so
    resetting this count doesn't make sense to me
    anyway.I don't know what you mean exactly but I am pretty sure this is wrong.
    Try this.
    recordCount = 1;
                   if(rs != null)
                        rs.last();
                        totalRows = rs.getRow();
                        rs.first();
                        System.out.println("Total Rows: "+totalRows);
                   if (rs != null) while ( rs.next() )
                        hasResults = true;
                                                         recordCount = 1;//new line here!
                        for(rowCount = 0; rowCount < totalRows; rowCount++)
                             for(columnCount = 0; columnCount < 9; columnCount++)
                                  SearchMenu.fieldArray[rowCount][columnCount].setText(rs.getString(recordCount));
                                  recordCount++;
                        }

  • Invalid descriptor error ???

    Hello -
    i am getting a
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Invalid descriptor index
    Can anyone help me with this error?
    the foll. is my piece of code -
    public boolean checkOldEntry(String n,String p) {
              String query;
              String pwd;
              ResultSet rs;
              query = "SELECT Password FROM Profile where" + "(Name = '"+n+"')";
              try{
                   st = con.createStatement();
                   rs = st.executeQuery(query);
                   while ( rs.next()){
                   pwd = rs.getString(2);
                   if (pwd.equals(p))
                        return true;
              }catch(SQLException sqlex){
                   System.out.println("checkOldEntry - sqlexception");
                   sqlex.printStackTrace();
              } finally {
                   try {
                        st.close();
                   //     con.close();
                   }catch(Exception ex){
                        System.out.println("checkOldEntry - general exception");
                        ex.printStackTrace();     
              }// end finall
              return false;
         }// end checkOldEntry

    It does not matter if the table has two columns. This query
    query = "SELECT Password FROM Profile where" + "(Name = '"+n+"')";
    is only selecting one of them. You will only get one column in your result set. If you want two columns in your resultset, use this query
    query = "SELECT Name, Password FROM Profile where" + "(Name = '"+n+"')";

  • Invalid column Index error - While consuming Calculation view via Native SQL

    Hi Experts,
    I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
    Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
    Thanks in Advance,
    Suma
    REPORT ZTEST_HANA2.
    *Report to consume Calculation view (script based) from ABAP
    PARAMETERS: ip_docnr type BELNR_D,
                ip_gjahr type GJAHR,
                ip_bukrs type BUKRS,
                ip_blgr type FAGL_RLDNR.
       DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
              LO_CONN     TYPE REF TO CL_SQL_CONNECTION,
              LO_RESULT   TYPE REF TO CL_SQL_RESULT_SET,
              LV_SQL      TYPE STRING,
              LR_DATA     TYPE REF TO DATA.
        DATA: LX_SQL_EXC           TYPE REF TO CX_SQL_EXCEPTION,
              LT_SEPMAPPS_CLSDINV  TYPE TABLE OF SEPMAPPS_CLSDINV,
              LV_TEXT              TYPE STRING.
        TRY.
    lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
                     |WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
                      |'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
                      |,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
                      |,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
             LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
             "Create an SQL statement to be executed via the connection
              LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
             "Execute the native SQL query
             LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
             "Read the result into the internal table lt_sepmapps_clsdinv
             GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
             LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
             LO_RESULT->NEXT_PACKAGE( ).
             LO_RESULT->CLOSE( ).
             LO_CONN->CLOSE( ).
        CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
             LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
             MESSAGE LV_TEXT TYPE 'E'.
        ENDTRY.

    Hi Suma,
    Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
    Check there if the parameters case is working properly... Is it really this confusing options:
    p_GJAHR
    S_BUKRS
    p_base_ledger
    Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
    Regards, Fernando Da Rós

  • Java.sql.SQLException: Invalid column index in database adapter

    I have a query that works fine if I run the sql in a JDeveloper SQL editor, but I get a "java.sql.SQLException: Invalid column index" error if I paste it in a database adapter. If I put this query in the adapter:
    select <column>
      from <table>
       where <column> in (select
        trim( substr (txt,
              instr (txt, ',', 1, level  ) + 1,
              instr (txt, ',', 1, level+1)
                 - instr (txt, ',', 1, level) -1 ) )
          as token
        from (select ','||#bindVariable||',' txt
                from dual)
      connect by level <=
         length(#bindVariable)-length(replace(#bindVariable,',',''))+1)I get the error. But if I just put the sub query in the adapter as:
    select
        trim( substr (txt,
              instr (txt, ',', 1, level  ) + 1,
              instr (txt, ',', 1, level+1)
                 - instr (txt, ',', 1, level) -1 ) )
          as token
        from (select ','||#bindVariable||',' txt
                from dual)
      connect by level <=
         length(#bindVariable)-length(replace(#bindVariable,',',''))+1the error goes away. Does anyone know what might be causing this?
    Thanks in advance

    Hi,
    Could you please make sure your binding style(Oracle Positional,Oracle named..etc) of the Seeded VO and Custom Vo are same.
    This is the option you will get when you are extending your vo. So make sure that both are same.
    You can refer the below link too
    VO extension leads to "Invalid column index" exception
    Thanks
    Bharat

  • Invalid Column Index Error

    Hi all,
    I am trying to create a new report using
    1. Crystal Report XI
    2. Oracle 9i
    3. A stored Procedure
    4. JDBC connection.
    But i could not do it.
    Invalid Column index error is coming.
    Can anyone help.
    Thanks
    Saravanakumar.

    I know this is an old thread but I too am getting a column index error accessing an Oracle 10g database stored procedure using Crystal Reports XI, using the New Report wizard to select the stored procedure.  It prompts me for the sp parameters; I select "set to null" and click OK and get
    Failed to retrieve data from the database. Details:  SQL Exception: [SQL State:] null [Error message:] Invalid Column Index [Database vendor code 17003]
    I can run the procedure and get data just fine with no errors using PL/SQL.

Maybe you are looking for