con = DriverManager.getConnection("jdbc:mysql:///jk","rjk", "sivaji");
con.setAutoCommit(false);
java.sql.Statement stmt = con.createStatement();
stmt.executeUpdate("INSERT INTO jk1(fname, lname) VALUES('a', 'b')");
stmt.executeUpdate("INSERT INTO jk1(fname, lname) VALUES('c', 'd')");
con.rollback();
stmt.executeUpdate("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....