This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes how to pass a resultset object in a function Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to pass a resultset object in a function" Watch "how to pass a resultset object in a function" New topic
Author

how to pass a resultset object in a function

MuraliH Krishna
Greenhorn

Joined: Jan 19, 2008
Posts: 9
Hai Ranchers,
I have a requirment of passing a resultset object to a function. When I try to access the resultset object in the receiving end, I am getting an error like closed resultset cannot be accessed. I can understand that we pass a reference to the calling function but is there a way to pass the resultset object and its data.Can some one help me please. its very urgent.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
It is better to copy the data from the ResultSet into a Collection class. You can then pass a reference to this Collection class to the function.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26192
    
  66

James is correct. It is better design for the ResultSet object to stay in the database layer.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to pass a resultset object in a function
 
Similar Threads
how to pass an object 'byvalue'
Serialzation is not working
how to pass resultset object as a parameter to a javascript function
table rows in JTable
Passing a Function and its Parameters as a Parameter