Same preparedstatement object 4 different queries..
Can I use like dis since it is not updating all the records..Its only taking the last one..
Actually i m getting same preparedstatement object for many queries in a loop..In this scenario its not working properly..
connection con.setAutoCommit(false);
PreparedStatement prepStmt = con.prepareStatement(
"UPDATE DEPT SET MGRNO=? WHERE DEPTNO=?");
prepStmt.setString(1,mgrnum1);
prepStmt.setString(2,deptnum1);
prepStmt.addBatch();
PreparedStatement prepStmt = con.prepareStatement(
"UPDATE EMP SET EMPNO=? WHERE DEPTNO=?");
prepStmt.setString(1,empno1);
prepStmt.setString(2,deptnum2);
prepStmt.addBatch();
Whether we can take same preparedstatement object for different query..??Its not giving any error but its not updating all the records but only the last one...