Solved

Is there a destructer or final method called in jsp beans (non-ejb)?

Posted on 2002-07-24
8
233 Views
Last Modified: 2010-04-01
Hello,

I have a jdbc bean (non-ejb) called by a jsp. I want the jdbc statements closed when the bean is no longer needed.

Is there a final, or destructer method that is called automatically?

thanks,

Keith
 
0
Comment
Question by:keithedward
  • 4
  • 2
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 7175200
servlets have a destroy() method where you can do your cleanup (just like the init() method for initialization)

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7175205
for JSPs this method is sometimes called jspDestroy()
0
 

Author Comment

by:keithedward
ID: 7175411
yes.... but what about the bean method for destory?

0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:keithedward
ID: 7175464
do I just put a destroy() method in the bean, and when the bean is no longer needed, the destory method is run?

0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 7175489
I thought you were talking about a jsp not a bean.

For standard java classes (beans) you should implement a finalize() method.  It is very weakly enforced (not like C's destructor) but you can call it explicitly.

CJ
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9561101
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"To be PAQd/no refunds."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 9562083
I thought I answered the question with my last comment.

CJ
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
maven scope 1 120
Reading data  from excel sheet and displaying 1 71
spring JDBC Template example error 26 158
Java Script nested call 3 54
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now