1.  No, you don't have to use JDBCRealm to connect to a database -
if you want Tomcat to manage the authentication and you want to authenticate
against a database, then, and only then, you need to use JDBCRealm.

        1.  (You have 2 Questions 1s) Putting the classesXXX.zip from Oracle
won't work, you need to rename the file to end with .jar (Spec requirement).
Doing this will probably solve your problems, because your ConnectionPool
class probably can't create the connection that you blindly use without
checking if its valid.

        Randy  

> -----Original Message-----
> From: Dennis Murphy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 12:07 AM
> To: [EMAIL PROTECTED]
> Subject: Need Help understanding Oracle JDBCRealm
> 
> 
> Hello,
> 
> BACKGROUND
> I'm a new JSP developer who just moved a simple application 
> over from JSERV
> to mod_jk.
> 
> My small application worked fine under JSERV. All it needs to 
> do is connect
> to an Oracle database to verify a USERNAME & PASSWORD.
> 
> QUESTION
> 1. Do you have to establish a JDBCRealm in order to connect 
> to a database?
> 
> BACKGROUND
> In my server.xml file I commented out the SimpleRealm code 
> and inserted the
> following:
> <!-- Added Oracle JDBC support dmurphy 25-Jun-01 -->
> <RequestInterceptor
>     className="org.apache.tomcat.request.JDBCRealm"
>     debug="99"
>     driverName="oracle.jdbc.driver.OracleDriver"
>     connectionURL="jdbc:oracle:thin:@localhost:1521:testdb"
>  />
> 
> I'm unable to start TOMCAT with this code in place.
> 
> QUESTION
> 1. I placed oracle.jdbc.driver.OracleDriver in my webapp 
> WEB-INF/classes
> folder.  Thus its accessible to my application.  Is this the 
> correct place
> to put the Oracle driver?  Do I need to add the Oracle driver to my
> classpath?
> 
> BACKGROUND
> Since I'm unable to get TOMCAT to start with my JDCBRealm in place - I
> commented it out in my server.xml file along with the SimpleRealm.
> 
> QUESTION
> Must I have at least the SimpleRealm in place?
> 
> BACKGROUND
> I moved on and was able to create a CONNECTION POOL using a 
> CONNECTION POOL
> servlet that worked with my JSERV application.  The 
> ConnectionPool servlet
> uses package javaservlets.jdbc
> 
> Anyway, when my application attempts to create a result set 
> (rs) it blows
> up. As seen below in the code segment:
> 
>     Connection conn = connectionPool.getConnection();
>     Statement qs = conn.createStatement();
>     ResultSet rs =
>       qs.executeQuery(SELECT_PASSWORD +
>       QUOTE + user + QUOTE);
> 
> This code gives me the following errors (condensed for readability)
> Internal Servlet Error:
> javax.servlet.ServletException
>  at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImp
> l.java:459)
> ...
> Root cause:
> java.lang.NullPointerException
>  at Chapter3.SessionManager.login(./Chapter3/SessionManager.java:373)
> ...
> 
> QUESTION
> Can someone please help me understand how to connect to an 
> Oracle database
> using Tomcat?  Do I need to setup a JDCBRealm?
> 
> Thank you for your assistance,
> Sincerely,
> Dennis
> 
> 

Reply via email to