Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> JDBC driver Bug

JDBC driver Bug

From: Frido van Orden <fridoo_at_faapartners.com>
Date: 10 Jan 2002 03:23:48 -0800
Message-ID: <f3709c8b.0201100323.5cc3abda@posting.google.com>


Hi,

I just discovered a very strange bug in the 9i JDBC drivers.

See the following code:

            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

            DriverManager.setLogWriter(new java.io.PrintWriter(System.out, true));

            Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@demo:1521:ora8", "faaj", "partners");

            conn.setAutoCommit(false);
            PreparedStatement stmt = conn.prepareStatement("SELECT
PRIORITY \"PRIORITY\", seq \"SEQ\" frOM todo WHERE seq = 363 FOR UPDATE", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
            ResultSet rs = stmt.executeQuery();
            rs.next();
            rs.updateLong("PRIORITY", (long) 1);
            rs.updateRow();


the rs.updateRow() throws an java.sql.SQLException: ORA-00904: invalid column name

If I remove the dummy PRIORITY column alias from the select statement it works fine....

Oracle has put a nice motto in their SQL reserved words appendix:

The words I use are everyday words and yet are not the same!

They appear applicable to me in this case too!

Regards,

Frido Received on Thu Jan 10 2002 - 05:23:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US