aspose file tools
The moose likes JDBC and Relational Databases and the fly likes Forward only ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Forward only ResultSet" Watch "Forward only ResultSet" New topic
Author

Forward only ResultSet

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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

Joined: Oct 13, 2005
Posts: 42698
    
  32
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

Joined: Jul 31, 2003
Posts: 294
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

Joined: Oct 13, 2005
Posts: 42698
    
  32
That's my idea gone isn't it?
Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
No!!!
Its an excelent idea, I will implement it if I won't be able to peek the result set...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Forward only ResultSet