Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invalid cursor state

 
Naadir Peterson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gettin an invalid cursor state exception when i try to get a record from the database using jsp..
its like:

ResultSet attempt = statement.executeQuery("SELECT Attempts FROM Users WHERE UserName = '" + username + "'");
String attemptTry = attempt.getString("Attempts");

i think the problem is the getString method
the "Attempts" is named right way out of the DB...
the resultset does return something but i still get the error

Attempts is a smallint in the database.. is it coz of that?
thanx
 
Santosh Jagtap
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
try this
ResultSet attempt = statement.executeQuery("SELECT Attempts FROM Users WHERE UserName = '" + username + "'");
attempt.next();
String attemptTry = attempt.getString("Attempts");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic