Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IF connection is closed?resultset will be closed or not.

843836May 5 2004 — edited May 5 2004
hi all,
i am just closing the sql connection and i am not closing the resultset.So is it must that we should close resultset?
if i close the connection resultset wont be closed automatically.?
here is my code.

s_user = conn.createStatement();
sql_user="select statment ";
rs_user=s_user.executeQuery(sql_user);

if (rs_user.next())
{

if (rs_user.getInt("found") !=0)
{
flag = rs_user.getInt("found");
out.print("flag="+ flag);

}
}

// if connection is not closed close the connection

if (!conn.isClosed())
{
conn.close();
}

if i use the above code any problem with db performance?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2004
Added on May 5 2004
4 comments
291 views