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.

Similar Messages

  • 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

  • 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

  • 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 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

  • 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.

  • 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.

  • 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.

  • 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.

  • 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 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 column type - SQL Exception during upload

    Hi,
    I am facing this error when trying to upload/commit values in my form to the database. Strangely, the error is not coming for the first upload (which makes me feel that the data types of all columns are correct) but it comes up for all subsequent uploads. any hint on what might be the issue? Let me know if any other information is needed from my end.
    >
    ADF: Adding the following JSF error message: Invalid column type
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:11256)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:10605)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:11665)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:11631)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:253)
    at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2193)
    at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10524)
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:412)
    at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8647)
    at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8579)
    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6816)
    at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3290)
    at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3093)
    at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2097)
    at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)
    at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)
    at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1417)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)
    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at sfi.apps.sso.ui.util.ADFUtil.invokeEL(ADFUtil.java:558)
    at sfi.apps.sso.ui.util.ADFUtil.invokeEL(ADFUtil.java:536)
    at sfi.apps.sso.ui.bean.ObsMainBean.onSubmit(ObsMainBean.java:69)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Invalid column type
    java.sql.SQLException: Invalid column type
    >
    Thanks,
    Prashanth.

    Ok. i was able to run my application module by disabling security. while trying to upload a row i am not able to update the value of a field and because of that i am not able to update thru AM.
    The field was created as a LOV (fixed list) in page def bindings and i am not able to enter the value while running my AM since it is not editable.
    The brief error message when updating from AM is below :
    [550] oracle.jbo.AttrValException: JBO-27014: Attribute ObsType in ObservationMainEO is required.
         at oracle.jbo.server.JboMandatoryAttributesValidator.validate(JboMandatoryAttributesValidator.java:224)
         at oracle.jbo.server.EntityDefImpl.validate(EntityDefImpl.java:3200)

  • 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+"')";

  • Error in accessing ResultSet - Descriptor index not valid SQL Exception

    Hi
    I am trying to execute a procedure in java and try to access the result set, but it is giving out Descriptor index not valid SQL Exception.
    While printing the first record the error is thrown the code is as follows. Any help would be appreciated. Thanks in Advance.
    1 . The Procedure
    CREATE PROCEDURE library.fetchssncursor()
    RESULT SETS 1
    LANGUAGE SQL
    BEGIN
    DECLARE c1 CURSOR WITH RETURN FOR
    SELECT * FROM VBPLTC.LTCP_DUMMY;
    open c1;
    END;2. Java Class
    public class TestFunction2
    public void getPassThruReport()
         Connection objConnection=null;
         ResultSet rs=null;
         CallableStatement callableStatement=null;
         try
              List returnList=new ArrayList();
              DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
              objConnection = DriverManager.getConnection("URL","USERID","PWD");
              callableStatement  = objConnection.prepareCall("{call fetchssncursor() }");
               System.out.println("Got Connection "+ objConnection.toString()); 
                 callableStatement.execute();
                 rs = callableStatement.getResultSet();
                 // callableStatement.executeQuery (); i also tried this
                if(rs!=null)
                  while(rs.next())
                       System.out.println(rs.getString(1)+","+rs.getString(2)+","+rs.getInt(3)+","+rs.getInt(4));
         catch(SQLException e)
              System.out.println("SQLException "+e);
         catch(Exception e)
              System.out.println("Exception "+e);
         finally
              try
                   if(rs!=null)     
                   rs.close();
                   if(objConnection!=null)
                   objConnection.close();
               catch (SQLException e) {
    public static void main(String args[])
           TestFunction2 obj = new TestFunction2();
           obj.getPassThruReport();
    }3. Output
    Got Connection S101C3DE
    shar,Sharath,123456,1 <------------- records
    SQLException java.sql.SQLException: Descriptor index not valid.(1574
    ****************************************

    http://www-03.ibm.com/servers/eserver/iseries/toolbox/troubleshooting.htm

  • SQL Exception: Invalid column index while calling stored proc from CO.java

    Hello all,
    I am getting a "SQL Exception: Invalid column index" error while calling stored proc from CO.java
    # I am trying to call this proc from controller instead of AM
    # PL/SQL Proc has 4 IN params and 1 Out param.
    Code I am using is pasted below
    ==============================================
              OAApplicationModule am = (OAApplicationModule)oapagecontext.getApplicationModule(oawebbean);
    OADBTransaction txn = (OADBTransaction)am.getOADBTransaction();
    OracleCallableStatement cs = null;
    cs = (OracleCallableStatement)txn.createCallableStatement("begin MY_PACKAGE.SEND_EMAIL_ON_PASSWORD_CHANGE(:1, :2, :3, :4, :5); end;", 1);
         try
    cs.registerOutParameter(5, Types.VARCHAR, 0, 2000);
                        cs.setString(1, "[email protected]");
                             cs.setString(2, s10);
    //Debug
    System.out.println(s10);
                             cs.setString (3, "p_subject " );
                             cs.setString (4, "clob_html_message - WPTEST" );
                   outParamValue = cs.getString(1);
    cs.executeQuery();
    txn.commit();
    catch(SQLException ex)
    throw new OAException("SQL Exception: "+ex.getMessage());
    =========================================
    Can you help please.
    Thanks,
    Vinod

    You may refer below URL
    http://oracleanil.blogspot.com/2009/04/itemqueryvoxml.html
    Thanks
    AJ

Maybe you are looking for

  • How to change my Apple ID for iCloud?

    Hey there, I have a simple enough question. When I originally signed up with Apple, I was using my Gmail account, so that became my Apple ID. However, I've been slowly migrating off of Gmail as I much prefer my new Apple email address (@me.com). For

  • C++ programmer  needs help in Java.

    Greetings, I am new to Java after programming in C++ and am having a few troubles finding parallels to a few essential operations, such as: What are the Java equivalents to cout, cin and getch()? Or simply, how do you do output, get input from the us

  • Why has my iPhone 'App Store' app frozen after IOS5 download?

    With an iPhone 4, iPad, iMac and Macbook, I am concerned that my iPhone 4 download of IOS5 has 'locked' my App Store app on my iPhone 4. It shows 7 apps requiring update, but has lines and arrows next to them and the screen is locked. I have to use t

  • Get computer client name

    I would like to know if it is possible to get the computer client name from Flex and if possible how to do it. Regards,

  • T60p Driver Problem - Win XP Downgrade

    Just downgraded to XP from Vista on my T60p (8743CTO). XP installs fine, but now I am missing the drivers for all my networking hardware so I am unable to get online to use System Update to reinstall everything else. In the Device Manager, Ethernet a