Try giving the Class.forName() in the init method of the servlet .This will
create only one instance.
Regards,

Vishal


>From: Xu Jianwu <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Servlet with JDBC
>Date: Mon, 22 May 2000 13:23:34 +0800
>
>I am developing servlets with JDBC API to access my database. In order to
>ensure that the database connection is created only once for the threads of
>a servlet, where or when should I Class.forName() and
>DriveManager.getConnection()? Should I override the construction method of
>(e.g.) HttpServlet and do them there?

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

___________________________________________________________________________
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

Reply via email to