aspose file tools
The moose likes JDBC and the fly likes Does CallableStatement have to be closed? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JDBC
Reply locked New topic
Author

Does CallableStatement have to be closed?

Jian Yi
Ranch Hand

Joined: Feb 01, 2002
Posts: 127
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
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
Please reply to this post


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
 
subject: Does CallableStatement have to be closed?
 
Threads others viewed
Insert CLOB data upto 2 GB data
How to intercept a "getSession" method?
Help in DBMS_OBFUSCATION_TOOLKIT
How to search record on (firstname+lastname) or (lastname+firstname)? please help me
Does CallableStatement have to be closed?
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture