1 posts in topic
Flat View  Flat View

Posted By:   sneh_kuamr
Posted On:   Friday, September 23, 2005 04:06 AM

i create a code for jdbc in this code when i enter flight number and click on query button then a Exception throw
Exceptionis:java.sql.SQLException:[Microsoft][ODBC Driver Manager] Invalid cursur state

Re: java.sql.SQLException

Posted By:   Anonymous  
Posted On:   Friday, September 23, 2005 07:55 AM

hi sneh,

Invalid cursor state will come when ever u r calling the getXXX() methods on a ResultSet with out calling the next() method on it use this if condition

if( resultSet.next() ) before caling any getXXX() methods.

this is compulsory bcoz the resultset u got after executing the executeUpdate() method will be one row before the actual result set to move to the first reslu set row u need to use the next() method
resultSet.next() will return boolean true:means u have rows false:means no rows are there for ur query even after getting false for next() method if u tried to call the getXXX() methods then also u will get the same exception

Krishna Rajendra Alapati :)
About | Sitemap | Contact