Forums Register Login

Why resultSet is null?

+Pie Number of slices to send: Send
I am using "com.ibm.db2.jcc.DB2Driver" to connect to DB2 Server.
After executing a query I'm getting null as a resultSet. The query should return 0 records. I have checked it via a database client Aqua Data Studio.

As far as I know that resultSet shouldn't be null, anyway. Am I right??
+Pie Number of slices to send: Send
Are you sure query is getting executed ???

Shailesh
+Pie Number of slices to send: Send
In API is written never null. If there is no exception, than it could be a bug in DB2 implementation.
+Pie Number of slices to send: Send
Yes Shailesh, i am printing resultSet just after getting it. It is showing me null.

No Exception even.
+Pie Number of slices to send: Send
interesting ??

could you please put the code ...might be something triggers ?

Shailesh
+Pie Number of slices to send: Send
 

Originally posted by David Ulicny:
In API is written never null. If there is no exception, than it could be a bug in DB2 implementation.



Yeah I know. Now I'm going to sue IBM for this silly implementation. It took my half an hour.

[edited]
No just kiddin. It took me less then 5 mins
[ September 19, 2005: Message edited by: Adeel Ansari ]
+Pie Number of slices to send: Send
 

Originally posted by Adeel Ansari:
Now I'm going to sue IBM for this silly implementation. It took my half an hour.



Give them some time to fix this implementation

I don't think it would first time when the query is returning zero result, none has reported same problem.

such problem may occur if it is beta release or first release of driver.


Shailesh
[ September 19, 2005: Message edited by: Shailesh Chandra ]
+Pie Number of slices to send: Send
 

Originally posted by Shailesh Chandra:
could you please put the code ...might be something triggers ?





Method fsexecuteQuery(String query)

+Pie Number of slices to send: Send
Its Ok guys now its working like charm. I promise I didn't do a thing to it. I just closed the project and opened it again.

Anyways thanks mates.
+Pie Number of slices to send: Send
1. Did you put System.out.println before executing query.......... ???

2. What is behaviour if everything goes well, when there are records available in database on given criteria.

3. your catch block in method fsexecuteQuery is not throwing exception out ??

Might be you didn't refresh log file to check error message and some exception occured


Shailesh
[ September 19, 2005: Message edited by: Shailesh Chandra ]
+Pie Number of slices to send: Send
 

Originally posted by Adeel Ansari:
Its Ok guys now its working like charm



Cheers


I just closed the project and opened it again



might be old class was loaded during your test


Shailesh
+Pie Number of slices to send: Send
ResultSets cannot be null when executed by the database, except when they are wrapped in a method as above where any failure in the method fsexecuteQuery will return a null ResultSet.
+Pie Number of slices to send: Send
 

Originally posted by David O'Meara:
ResultSets cannot be null when executed by the database



Know that quite well.


except when they are wrapped in a method as above where any failure in the method fsexecuteQuery will return a null ResultSet.




Cent percent valid point.

It was my carelessness. I didn't tried hard to figure it out. Legacy code screws most of the time.

Actually it was faced by one of my colleague and I posted the question. When Shailesh asked for code, then I realized that mistake is somewhere inside that method.

Thanks David.
+Pie Number of slices to send: Send
Bah, do not get me started about legacy code. You do not want to get me started! Glad it's solved though.
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1241 times.
Similar Threads
How DBUnit is works
JDBC query working. Servlet with same code throwing NullPointerException
a simple question about "ResultSet"
Recordset inside a recordset?
problem in query
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 23:57:23.