Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC driver Bug
You can remove aliases, or, at least,
quotes around aliases...
AlexV
"Frido van Orden" <fridoo_at_faapartners.com> wrote in message
news:f3709c8b.0201100323.5cc3abda_at_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 Fri Jan 11 2002 - 06:46:22 CST