Statement接口

注意:

1.关闭连接顺序:ResultSet-->Statement-->Connection 。
2. 关闭时异常一定要三个分开写try/catch。原因:某个异常不互相影响

if(rs!=null){ //RsultSet rs
   rs.close();
}
if(ps!=null){ //PreparedStatement ps
   ps.close();
}
if(conn!=null){ //connection conn
   conn.close();
}

猜你喜欢

转载自blog.csdn.net/qq_41877184/article/details/93398625