This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes unable to obtain result set row count Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "unable to obtain result set row count" Watch "unable to obtain result set row count" New topic

unable to obtain result set row count

Charlotte Shearrill
Ranch Hand

Joined: Dec 07, 2001
Posts: 34
Passing certain values to my callableStatement causes my resultset to be empty (which is to be expected� sometimes). When my statement is executed (stmt.executeQuery() ) it bombs, giving me the following error message: java.sql.SQLException: unable to obtain result set row count. From {call sp_GetMainName(?,?)}
Should not my executeQuery statement work, moving to the statement, skipping the current record if it is empty?

[ Edited by Dave to format code ]

[This message has been edited by David O'Meara (edited December 13, 2001).]
Charlotte Shearrill
Ranch Hand

Joined: Dec 07, 2001
Posts: 34
i am still uncertain about the cause and solution of this problem. in order to get it working, for the present,i had to NOT use my stored procedures.
if anyone finds solution for this please assist me in figuring this out. i will come back to it later after i have gotten more of my other tasks completed.
thanks in advance,
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 567
I've not come across that SQL Exception before. Perhaps you should analyse the SQLException more to get some more info out of it. You can use .getErrorCode() to get the vendor-specific database error, and you can use .getNextException() to see if there are any more SQLExceptions (with more info) hanging on the back of it.
You can even call Connection.getWarnings() to see if there is any info there. Good luck,

I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: unable to obtain result set row count
jQuery in Action, 3rd edition