This week's book giveaway is in the Performance forum. We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line! See this thread for details.
I need to modify the following code in a way that the upper level will handle the SQLException. The original code is:
I understand that I need to move the catch block to the upper level and declare the methods with throws SQLExeption. My question is, if SQLException is thrown at the line of "val = cstmt.executeUpdate();" then it got thrown to upper level. So the cstmt never gets closed (that's what finally block is doing). I wonder if it is ok for cstmt without being closed. What could happen? Or, is it possible that when CallableStatment::executeUpdate() throws a SQLException, it closes the statement for us automatically? Thanks a lot, Jenny