领测软件测试网
软件测试技术门户.~H
?e[t%xConnection conn = null;
[@8o*]8o&dtry{
{5NFglconn = DBConnectionFactory.getConnection;
X!}+||Gm|conn.setAutoCommit(false); //do something
F"IJ&eyD(zconn.commit(); //commit transcation
L9p7M5Op6~}catch(Exception e){
软件测试技术门户yn B.v.j-i#|3Kaconn.rollback();
)i[ N4qP$Wr}finally{
软件测试技术门户9g'FU&A0P1Jc|try{
$@m*CV.BY'p,S9p:fN$zconn.close();
] v2\9V*OG+IYED}catch(SQLException se){
软件测试技术门户$q+Bq"e"Y1_.L;D#D//do sth.
软件测试技术门户i`%Zd\}
软件测试技术门户,K{&]lx1aQNd//close ResultSet,PreparedStatement,Connection
/]EG'mT//notice:Maybe ocurr Exception when u close rs,pstmt,conn
软件测试技术门户 c5x,p3ot+@H-L*Lm}
软件测试技术门户@}8CY${
M6s 9n3F!J&X