Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

depend relations among JDBC objects

Status
Not open for further replies.

zhuzhengyu

Technical User
Jul 21, 2000
19
CN
JDBC have 3 objects:
Connection,Statement,ResultSet

Several qustions:
1)if Statement is closed,the ResultSet produced by the Statement will close automatically?
also if the Connection is closed,the related Statements and ResultSets will close automatically?

2)if several Statements share a Connection whether problems will occurs while multi-users do query at the same time?
and if several ResultSets could share a statement?

eg:
Connection con=DriverManager.getConnection(URL,user,pass);
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from table_a");
ResultSet rs1=st.executeQuery("select * from table_b");
st.executeUpdate("delete from table_c");

if could,on which condition?
if couldn't ,what's th result?

Hope for advice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top