> -----Original Message-----
> From: Andreas Horchler [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 11:17 AM
> To: Tomcat-User
> Subject: How to make a database connection in a servlet ?
> 
> 
> 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
> 
> 

You'll be using a regular JDBC connection to connect to any type of database
from your servlets, just like from the "regular" java applications.  Local
or remote, it's irrelevant (provided your JDBC driver supports remote
connections, and since you're using Oracle that's a non-issue: Oracle has
excellent Type 4 JDBC driver).

If you're new to Java, I strongly suggest you go through excellent tutorial
Sun has put up at http://java.sun.com/docs/books/tutorial/.  Most topics are
well-covered and should at least get you going.  JDBC trail is at
http://java.sun.com/docs/books/tutorial/jdbc/index.html

Good luck!

Regards,



Emir.


DISCLAIMER: The content of the preceding message is exclusively
            the personal opinion of the author, i.e. myself. Under no
            circumstances should the content be attributed to my employer.

Reply via email to