Hello All,
I had this problem earlier and someone suggested to use the setAutoCommit() method. Well I did try it and I am still getting the same problem as below. Is there something wrong with how I have constucted my setAutoCommit method and the other methods that work with it?
PROBLEM:
I have an sql statment, inside a loop so each loop though it will insert the right data to the database. Lets say the code is going to loop 4 times. The problem is I have an error in my sql statement on the last loop, the 3 previous loops will execute but the last loop will thow an exception. This is not what I want, I want the code to thow the exception first before any data is executed to the database if there is an exception, if not then execute the data.
Thanks
Ben
I had this problem earlier and someone suggested to use the setAutoCommit() method. Well I did try it and I am still getting the same problem as below. Is there something wrong with how I have constucted my setAutoCommit method and the other methods that work with it?
PROBLEM:
I have an sql statment, inside a loop so each loop though it will insert the right data to the database. Lets say the code is going to loop 4 times. The problem is I have an error in my sql statement on the last loop, the 3 previous loops will execute but the last loop will thow an exception. This is not what I want, I want the code to thow the exception first before any data is executed to the database if there is an exception, if not then execute the data.
Thanks
Ben