Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Oracle driver NullPointerException

Thread view: 
timjowers - 02 Nov 2007 16:42 GMT
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)
Roedy Green - 03 Nov 2007 04:13 GMT
>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.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Chris ( Val ) - 03 Nov 2007 09:44 GMT
On Nov 3, 2:13 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

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

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.

--
Chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.