Sam Rose wrote:
> Hi,
>
> I was wondering which approach would be best for my servlet's that I
> am currently developing.
> All of the servlets connect to an Oracle database.
>
> I was wondering do I need to use an init() and destroy() in my coding,
> can I leave this out or would that be a bad idea? As couldn't I just
> use finally clause, or have I lost the plot altogether?
>
> Sam Rose
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
I guess that you make the connection to DB in each service or doXXX method.
This is a bad idea because the connection takes a long time to make it in each
service. You should create it in the init method or use a connection pool.
Search the archives for a connection pool example.
Aurelio
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html