This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design 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