This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Init & Destroy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
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
 
 
subject: Init & Destroy
 
Similar Threads
Closing The connection (Database)
How to use the connection object defined in another class from the Main class
Tomcat Connection Pool
Access database from a class file
diff between con=null and con.close()