posted 22 years ago
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