dcsimg
Invalid Cursor state when no records are found
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Matt_Davis
Posted On:   Tuesday, February 26, 2002 12:39 PM

I am using a PreparedStatement to get information from my database which is to be stored in an array. Because of this I am using: ResultSet.TYPE_SCROLL_INSENSITIVE ResultSet.CONCUR_READ_ONLY So that I can call the last() method in order to initalise the array. Everything works fine when records matching the query are found but if nothing is found I get Invalid Cursor state error. I have done some error checking to narrow down what is causing this to be thrown, it appears to be the executeQuery() method that trips it. If anyone has come across this problem before I would be grateful for any help they can offer. If this is the way it is supposed to work maybe som   More>>

I am using a PreparedStatement to get information from my database which is to be stored in an array. Because of this I am using:



ResultSet.TYPE_SCROLL_INSENSITIVE

ResultSet.CONCUR_READ_ONLY

So that I can call the last() method in order to initalise the array. Everything works fine when records matching the query are found but if nothing is found I get Invalid Cursor state error.

I have done some error checking to narrow down what is causing this to be thrown, it appears to be the executeQuery() method that trips it.


If anyone has come across this problem before I would be grateful for any help they can offer. If this is the way it is supposed to work maybe some helpfull pointers to rearange my code wouldn't go amiss.


Thanks,

Matt Davis    <<Less
About | Sitemap | Contact