aspose file tools
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state " Watch "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state " New topic
Author

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 168

Hi all am getting the above error for my login code
Here's my code


please help am not able to find the solution.
Many Thanks!
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
After the instruction at line 29 you miss the instruction that checks if there are rows in your resultset and eventually moves to the first row.
I mean:



You must make this check before getting the coulmn values, i.e. at or before line 37





Bye,
Nicola
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19959
    
  25

I suggest you skip the database connection and query if the username and/or password is null or empty. If you end up at line 32 you will have gone to the database for nothing.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state