Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving data from cachedRowSet

 
renu richard
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using somehting like this,
loRS.getString("employee_no") to fetch the value from the Resultset object. Employee_no is the column name in the table.
I am trying to find the maximum value in a column by using the query
select max(marks) from employee.Now i tried using the int max_marks=loRS.getInt(1);
But i am getting java.sql.SQLException: Invalid cursor position exception.
Please tell me how can i retrieve the value. Thanks.

What i want to know is how can i get the value from the resulset object if i don't have the column name. As in this case, in which it is returniing the maximum value of a particular column.
[ November 27, 2008: Message edited by: renu richard ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to call "next()" on the result set before you can get data from it. For example:
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More related to DB than beginner.
Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic