con = DriverManager.g etConnection("j dbc:mysql:///jk","rjk", "sivaji");
con.setAutoComm it(false);
java.sql.Statem ent stmt = con.createState ment();
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('a', 'b')");
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('c', 'd')");
con.rollback();
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('x', 'y')");
con.commit();
By ths code the records containing values a,b and c,d should nt be saved bt the record containing x,y should be saved...bt all the three records r getting saved...Pls help....
con.setAutoComm it(false);
java.sql.Statem ent stmt = con.createState ment();
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('a', 'b')");
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('c', 'd')");
con.rollback();
stmt.executeUpd ate("INSERT INTO jk1(fname, lname) VALUES('x', 'y')");
con.commit();
By ths code the records containing values a,b and c,d should nt be saved bt the record containing x,y should be saved...bt all the three records r getting saved...Pls help....
Comment