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 / Databases / July 2006

Tip: Looking for answers? Try searching our database.

NullPointer exception in jdbc preparedStatement

Thread view: 
lordy - 21 Jul 2006 04:37 GMT
When executing a prepared statement I get a null pointer exception
in jdbcResultSet.
It only occurs on my Solaris box intermittently. I havent seen it happen
on my Linux box. I suspect its a sync/race condition issue in hsqldb,

This in one of 12 threads all doing similar tasks.

Any ideas?

21/07 03:53:05 S LCB1 run:java.lang.NullPointerException:null            (StreamListener.run)
       at org.hsqldb.jdbc.jdbcResultSet.<init>(Unknown Source)
       at org.hsqldb.jdbc.jdbcPreparedStatement.executeQuery(Unknown Source)

The statement itself is simply
'SELECT MAX(COL_NAME) FROM TABLE_NAME'

Lordy
lordy - 21 Jul 2006 05:37 GMT
> When executing a prepared statement I get a null pointer exception
> in jdbcResultSet.
> It only occurs on my Solaris box intermittently. I havent seen it happen
> on my Linux box. I suspect its a sync/race condition issue in hsqldb,

Its OK . a stray 'static' keyword mean the threads were trying to access
the same statement.

Lordy
Scott D. Bartholoma - 24 Jul 2006 19:16 GMT
> When executing a prepared statement I get a null pointer exception
> in jdbcResultSet.
[quoted text clipped - 13 lines]
>
> Lordy

If there are zero rows in the table, the MAX function will return a
null.  You have to handle that possibility using the ResultSet.wasNull()
method.


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.