tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dka...@molex.com
Subject Re: How to make a database connection in a servlet ?
Date Tue, 31 Jul 2001 07:49:50 GMT

I would suggest you make a standard jdbc connection in servlet which
is loaded at startup and put this connection to HttpSession object for
using by another servlet in your app. Be sure you have JDBC driver in
your lib folder (within your web app).

Another way is to use connection pooling (try poolman).


Hope this is help for to start.
Dalibor


______________________________ Reply Separator _________________________________
Subject: How to make a database connection in a servlet ?
Author:  tomcat-user@jakarta.apache.org (Andreas Horchler
<Andreas.Horchler@DispatchX.de>) at INTERNET
Date:    31.7.2001 2:16





Hi,
I am running Apache 1.3.20, Tomcat 3.2.3 and JDK 1.3.1 from Sun on
Windows NT and
everything is working fine.
Because these are my first experiences with a web server, I had a look
at several samples
delivered with Tomcat.
But how will I be able to connect from a sevlet to an Oracle 8.1.6
database server
(not running on the local machine) ?
Do I have to use the RequestInterceptor JDBCRealm declared in the
serverl.xlm file ?
On the machine running the Apache and Tomcat I have an Oracle client
8.1.7 installed.

Can anyone explain to me the steps I have to follow, and explain how
they work ?
(a few lines of sample code would be very nice)

Thanks in advance and regards

Andreas




Mime
View raw message