#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0

    connecting to oracle database using tomcat


    I want to use connection pool in my servlet.

    This is the error message i am getting-
    "Error Message is:java.sql.SQLException: Cannot load JDBC driver class 'null'"

    I have made necessary changes in web and server.xml..
    server.xml
    -------------
    <Resource name="jdbc/myoracle" auth="Container"
    type="javax.sql.DataSource"/>

    <ResourceParams name="jdbc/myoracle">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbcracle:thin:myschema@127.0.0.1:1521:mysid</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>scott</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>tiger</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>20</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>10</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>-1</value>
    </parameter>
    </ResourceParams>

    web.xml
    -----------
    <resource-ref>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Here is my code..

    Thanks in advance..
    Attached Files
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Hyderabad, India
    Posts
    19
    Rep Power
    0
    Where are the Oracle JDBC drivers? Are you sure they are in the CLASSPATH ?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0
    Thanks for helping me..

    I have included oracle.jar(driver) in the classpath.

IMN logo majestic logo threadwatch logo seochat tools logo