Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Forward only ResultSet

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I have forward only ResultSet object, the result set contains:
Id and record count as :
"Select id,count(*) from my_Items"

for example:
1,20
2,20
3,20
5,20
...

The problem is I cannot change the ResultSet type because its a legacy application,
Is it possible to peek to the second column to view the count(*)
Or to get number of records on the ResultSet ?
Thank you
Sharon
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not put the contents of the ResultSet into a List? Then you can play with it to your heart's content.
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the ResultSet Object is later passed into another service that display the results,Creating a list will cause the ResultSet to point on the last record with no option to go back...
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's my idea gone isn't it?
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No!!!
Its an excelent idea, I will implement it if I won't be able to peek the result set...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic