I am using the following code to Insert data into a table.
test_conn.setAutoCommit(false);
stmt = test_conn.prepareStatement("INSERT INTO ...");
while(RSet.next()){
for(int i = 1; i <= columnCount; i++){
stmt.setString(i, RSet.getString(i));
}
stmt.addBatch();
}
stmt.executeBatch();
test_conn.commit();
other processing methods to occur only all the above rows are successfully inserted....
when I Insert into table using executeBatch()
, if an SQL Exception or Error occurs in Inserting , is it possible to find Insertion of which Record has thrown the exception?