Try using a connection pool, you can get a good example in the book
"Professional Java Server" from Wrox.
good luck!
----- Original Message -----
From: A.R.Karthikeyan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 07, 2000 9:19 AM
Subject: servlets to database connection
> Hi everybody,
> I've developed a site entirely on servlets and the first page is the login
> page generated by a servlet,where a connection to the Access database is
> established during the init lifecycle of the servlet,so when there are
> several users logging on to this site a database connection is already
> achieved and so it leads to faster verification of the login details.I
have
> not closed this connection anywhere in this servlet.
> If the login is successful ,then a session is created for every user so
that
> he can traverse accross the other pages of the sites where by each and
every
> page is generated by a separate servlet program.
> Some of these pages consist of form fields which need to be saved in the
> Access database.
> My question is should I establish a connection in the init event of each
of
> the servlets that generate HTML pages with connectivity to the database or
> since a connection to the database has already been achieved by the
servlet
> which generated the login page (& not yet closed ),so can i use the same
> connection object that pertains to the first servlet in my remaining
> servlets to make updates to the database.
> Looking forward to some help from you.
> Thanks in advance
> Karthikeyan A.R
>
>
___________________________________________________________________________
> 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
___________________________________________________________________________
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