executeQuery returns null with DB/2 v7 and JDBC2 driver under Websphere
Posted on 2006-07-10
I am investigating a database connectivity problem involving DB/2 under Websphere. Details:
DB/2 v7 (remote d/b server, and local client on web app server)
JDBC 2.0 DB/2 driver in SQLLIB\java\db2java.zip (it appears that the usejdbc2 script has been run)
The machine is a test server, set up identically (as far as my client can tell) to a live server that is known to work. However, they reported a problem connecting to the database.
Careful debugging revealed that the following line of code is behaving in a way that contradicts the documentation:
ResultSet set = statement.executeQuery();
executeQuery() is never supposed to return null, but it demonstrably does. All the other objects, statement, connection etc. have been checked and look fine - it's just that instead of a resultSet (even an empty one would be good) we are getting a null reference back.
Edit: just wanted to add that this is on Windows 2000 Server. Thanks!