aspose file tools*
The moose likes JDBC 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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
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: 149

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: 19552
    
  16

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
 
Similar Threads
need some help in MVC
java .lang .Number Format Error
how to keep register page data if register fails
Login Module for Online Test Application
'The requested resource is not available' error