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.