Oracle driver NullPointerException

T

timjowers

Running this code across lots of tables in Oracle and it works fine in
MySQL, Postgres, and for some tables in Oracle. Anyhoo, let me know if
you have insight on the following. I went to ORCL's site but did not
see any easy way to report the bug.

table: ORA_KGLR7_IDL_SB4
String select = "select * from " + table + " WHERE 1 = 0";
rs = stmt.executeQuery(select); ...

Exception in thread "main" java.lang.NullPointerException
at oracle.jdbc.driver.T4CTTIdcb.fillupAccessors(T4CTTIdcb.java:726)
at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:184)
at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:97)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:594)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
at
oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:
431)
at
oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:
942)
at
oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:
463)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
1037)
at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
1183)
at db2web.DBInfo.getTables(DBInfo.java:94)
at db2web.TableToWeb.retrieveTables(TableToWeb.java:73)
at db2web.TableToWeb.main(TableToWeb.java:106)
 
R

Roedy Green

String select = "select * from " + table + " WHERE 1 = 0";
rs = stmt.executeQuery(select); ...

since 1 is never 0, why are you doing this? It should return nothing.
 
C

Chris ( Val )

since 1 is never 0, why are you doing this? It should return nothing.

It is a special trick/query used to return all the columns
in a table without any data, but I can't see its immediate
validity in this context.

It is normally used to create a copy of a table without data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top