Solved

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

Posted on 2002-07-24
8
235 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apache server configuration 7 80
attribute vs parameter and setter vs add method 17 83
EJB MDB example 4 79
how to add new optional parameter to JSP 1 29
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

18 Experts available now in Live!

Get 1:1 Help Now