File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Forward only ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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: 39386
    
  28
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: 39386
    
  28
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