Just call: // Close the result set rs.close(); // Close the statement stmt.close(); // Close the connection con.close();
Joined: Aug 13, 2002
Jeff - I should have been clearer on the description of my problem. I know how to close the objects. What I need to figure out where to put the code in order to guarantee that it gets executed. Since the app is interactive, the user can exit at anytime by clicking the 'x' in the corner of the window. If I just put the close() code in the main() method it won't get executed. Dave
You should have a windowClosing(WindowEvent w) in your application. This way, when your frame gets closed for any reason, this method will get called. You should put your "Cleanup Code" in here, or call a cleanup method from there.