Re-execute the statement with another sql without close

Will The first statement sent to the database be close after the execution the second?

String sql = "select * from emp";

Statement stmt = cn.createStatement();

ResultSet rs = stmt.executeQuery(sql);//first

while(rs.next()){

......

}

sql = "select * from dept";

rs = stmt.executeQuery(sql); //second

while(rs.next()){

......

}

Thanks Guilherme.

[432 byte] By [guilherme_muniz] at [2007-9-26 4:20:09]
# 1
from my understanding of databases is if you open a connection to the database then that client or whatever has access to whatever permissions are set up for that connection (ie user), so in short you are just querying tables.. not opening new database connections.
xascendent at 2007-6-29 17:23:14 > top of Java-index,Archived Forums,Java Programming...
# 2
when the statement executes the 2nd query, the first resultset is automatically closed.Jamie
jlrober at 2007-6-29 17:23:14 > top of Java-index,Archived Forums,Java Programming...
# 3
But, does that close any open cursors on the end of the DB? I would prefer doing a "stmt.close()" before executing the second query.
vijayreddy at 2007-6-29 17:23:14 > top of Java-index,Archived Forums,Java Programming...