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

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
 
keithedwardAsked:
Who is Participating?
 
cheekycjCommented:
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
 
cheekycjCommented:
servlets have a destroy() method where you can do your cleanup (just like the init() method for initialization)

CJ
0
 
cheekycjCommented:
for JSPs this method is sometimes called jspDestroy()
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
keithedwardAuthor Commented:
yes.... but what about the bean method for destory?

0
 
keithedwardAuthor Commented:
do I just put a destroy() method in the bean, and when the bean is no longer needed, the destory method is run?

0
 
KuldeepchaturvediCommented:
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
 
cheekycjCommented:
I thought I answered the question with my last comment.

CJ
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.