Dear All,
I would like to know
1.the purpose of statement closing in java
2.what will happen if i didnt give stmt.close() in my program
try{
Statement DelQTY=OPConnect.createStatement();
Statement DelPMQTY=OPConnect.createStatement();
Statement DelPReq = OPConnect.createStatement();
Statement DelPro=OPConnect.createStatement();
Statement DelPPro=OPConnect.createStatement();
String DelSql="DELETE FROM ITEM_REQUIRES_MAT WHERE ITEM_NO=6364;
String DelPM="DELETE FROM PROGRAM_MATERIAL WHERE ITEM_NO=6364;
String DelPReqPro="DELETE FROM PROGRAM_REQ_PRODUCE_MAT WHERE ITEM_NO=6364;
String DelProcess="DELETE FROM PROCESS_TRANSFORMS_MAT WHERE ITEM_NO=6364;
String DelPProcess="DELETE FROM PROGRAM_PROCESS_TRANSFORMS_MAT WHERE ITEM_NO=6364;
DelPReq.executeUpdate(DelPReqPro);
DelQTY.executeUpdate(DelSql);
DelPMQTY.executeUpdate(DelPM);
DelPro.executeUpdate(DelProcess);
DelPPro.executeUpdate(DelPProcess);
DelQTY.close();
DelPMQTY.close();
DelPReq.close();
DelPro.close();
OPConnect.close();
}
This is my sample code here i missed DelPPro.close() catch(SQLException e) { e.printStackTrace(); }