aspose file tools
The moose likes JSP and the fly likes Init & Destroy Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Init & Destroy" Watch "Init & Destroy" New topic
Author

Init & Destroy

hammer jan
Greenhorn

Joined: Oct 04, 2002
Posts: 5
Hello everyone:
when i create a connection in
public void jspInit(){//create conn there.}
and want to close the connection when i close the jsp window, i write it in Destroy:
public void jspDestroy()
{ try{if(conn!=null) conn.close();conn=null;
catch(Exception){}
}
but when i close the window
i found the connection is still alive!

please help how can i close the connection
when i close the jsp explorer window
thanks for any reply
hammer


SCJP
Alex Sack
Greenhorn

Joined: Jul 14, 2003
Posts: 5
rethink what your are asking ...
Hint: a jsp-page has nothing to do with the browser window & vv.
asac
hammer jan
Greenhorn

Joined: Oct 04, 2002
Posts: 5
ok i change my question :
When the container(VM) will call the jspDestroy method ?
thanks for any reply
hammer
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Init & Destroy
 
Similar Threads
Access database from a class file
Tomcat Connection Pool
diff between con=null and con.close()
Closing The connection (Database)
How to use the connection object defined in another class from the Main class