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 Result Set .Code check please 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 "Result Set .Code check please" Watch "Result Set .Code check please" New topic
Author

Result Set .Code check please

Gorakshanath Pandey
Greenhorn

Joined: Feb 25, 2004
Posts: 11
ResultSet dtrs;
String dtsql;
while(temprs.next())
{
int Fyear=temprs.getInt("fy");
int Fquarter=temprs.getInt("quarter");
dtsql="Select * from ofeis.dss_lfyquarter where fy=" + Fyear + " and quarter=" + Fquarter;
dtrs=SelQuery(dtsql,con); //Error:works elsewhere
}
Is this code OK....I am reassigning the Resultset dtrs
for each instance of new Query.
Thanks,
Gorakshanath Pandey.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26200
    
  66

Gorakshanath,
It would be better if you closed the resultset before assigning it a new value. Other than that, you should be ok.


[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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Result Set .Code check please
 
Similar Threads
datearray
Passing array of objects......ResultSet
Resultset Problem
set the values
how to get number of months between two given dates in java