I don't know why it is getting that error.  However, why do you cast your
result set to an OracleResultSet.  The jdbc api is designed to abstract
vender specific code.  I would go to basics and verify that everything is
set up correctly and make sure the column selected can in fact converted to
a string.


>From: qfjiang <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: why in Oracle Jdbc Driver i can't use
>preparedStatement.executeQuery("select f1 from test form update")
>Date: Mon, 15 Jan 2001 16:21:20 +0800
>
>Hi,
>   I am using Oracle Jdbc Driver , the code is like following:
>
>try{
>             Connection con= getConnect();
>             String sql="select f1 from ttt for update";
>              PreparedStatement stmt = con.prepareStatement(sql);
>              ResultSet rs= stmt.executeQuery();
>             OracleResultSet ors=(OracleResultSet)rs;
>             if(ors.next()){
>                  System.out.println("****"+ors.getString(1));
>              }
>             ors.close();
>             stmt.close();
>             con.close();
>        }catch(Exception e){
>             e.printStackTrace();
>         }
>
>when table have rows it will throw exception like following , but not
>happen is there is no rows selected ,
>why , is Oracle Jdbc Drive have bug ?
>
>java.sql.SQLException: ORA-01002: ??????( reading is violate sequence)
>         at
>oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
>         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
>         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
>         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
>         at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
>         at
>oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
>a:1681)
>         at
>oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
>nt.java:1870)
>         at
>oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
>edStatement.java:363)
>         at
>oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
>dStatement.java:314)
>         at Save1.main(Save1.java:20)
>
>Thank you !
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to