Can ResultSets be passed between methods of a class? Are there any special usage considerations?

Location: http://www.jguru.com/faq/view.jsp?EID=245663 Created: Nov 5, 2000 Modified: 2000-11-20 21:48:12.454 Author: Ryan Breidenbach (http://www.jguru.com/guru/viewbio.jsp?EID=45212) Question originally posed by Daniel Yawitz (http://www.jguru.com/guru/viewbio.jsp?EID=241695 Yes. There is no reason that a ResultSet can't be used as a method parameter just like any other object reference. You must ensure that access to the ResultSet is synchronized.

This should not be a problem is the ResultSet is a method variable passed as a method parameter - the ResultSet will have method scope and multi-thread access would not be an issue. Aa an example, say you have several methods that obtain a ResultSet from the same table(s) and same columns, but use different queries. If you want these ResultSets to be processed the same way, you would have another method for that.

This could look something like: public List getStudentsByLastName(String lastName) { ResultSet rs = ... (JDBC code to retrieve ... more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions