tiagoml
asked on
Can´t i use a ResultSet after i close the connection?
I starting to work with JAVA but i have worked with MSSQL Server 2000 using VB6 for a while, with VB i had to "manualy" clone the RecordSet if i wanted to work with it after i closed the connection to the DB, does JAVA have the same problem? when i close the connection the resultSet also closes?
If so do i have to run the resultset copying it row by row into a disconected one so i can keep it after i close the connection?(thats wath i did in VB :( )
thanks
If so do i have to run the resultset copying it row by row into a disconected one so i can keep it after i close the connection?(thats wath i did in VB :( )
thanks
Why would you want to work with a resultset after the connection is closed?
________
radarsh
________
radarsh
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is a method populate(ResultSet rs) in CachedRowSet.
Use it for and then use the CachedRowSet object.
Use it for and then use the CachedRowSet object.
ASKER
There is a method populate(ResultSet rs) in CachedRowSet.
Use it for and then use the CachedRowSet object.
I cant seem to find that method :(.
very newbie, sorry.
As for what i want it for, its because im gonna work with the data to give a result but im not doing anything to the DB after that, so theres no reason to let the connection be open if im not doing anything with it anymore :)
The method is not present in the interface but is there in the concrete implementation classes ;).
Which CachedRowSet impl are you using ?
Which CachedRowSet impl are you using ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think mrigank deserved some points here.
ASKER
thanks for the code rama_krishna580'
thanks mayankeagle also
i acepted rama_krishna580's answer because of the sample code. As is said im a real noob at java :D. Hope i did the right thing.
thanks mayankeagle also
i acepted rama_krishna580's answer because of the sample code. As is said im a real noob at java :D. Hope i did the right thing.
Well, you have an option of splitting the points between experts. You should not always accept a comment which blankly gives you all the code because in some cases, it is against EE rules (like in homework questions, though this one might not be homework).
ASKER
this is not homework :D
i didnt see that ... can i do the spliting now?
I've asked Venabili, our Page Editor to re-open this question. Then you can split the points by following the Split Points link which will be shown above the Comment box.
ASKER
ok ill wait for it then :D
thanks
thanks
________
radarsh