This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
Hi all. I have some questions about transactions. 1. as you know, getErrorCode( ) method returns a vendor's error code, so maybe differ from database to other. does getSQLState( ) method return a fixed value for a specific problem ? I mean, I have MYSQL database and I shut it down, when catching the SQLException and calling getSQLState( ) method, I got 08S01. if I have oracle database and repeat these steps, will I recieve the same status ? 2. I have the following code :
now, if SQLException is thrown , what should I do at catch statement ? should I called con.rollback( ) method and then rethrow the exception ? 3. what does setHoldability( ) method mean ? when to use it ? I have read the API but I don't understand it. 4. In which situation I should use save points ? your help is really appreciated. thanks a lot.