JNDI: Tomcat + Oracle

Discussion in 'Java' started by cccc, May 13, 2004.

  1. cccc

    cccc Guest

    Hi,
    I try this exercise: JNDI in Tomcat + Oracle bad this non work.

    1/3)
    I copy a file ojdbc14.jar in /common/lib Tomcat folder

    2/3)
    I write in server.xml Tomcat file:
    .....
    .....
    <Resource name="jdbc/Test" type="javax.sql.DataSource" scope= "Shareable"
    auth="Container"/>
    <ResourceParams name="jdbc/Test">
    <parameter>
    <name>user</name>
    <value>oe</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>adminoe</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:eek:racle:thin:mad:192.168.1.100:1521:MYDB</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>15</value>
    </parameter>
    <parameter><name>maxIdle</name>
    <value>15</value>
    </parameter>
    </ResourceParams>
    .....
    .....

    3/3)
    I write in my java code:
    .....
    javax.naming.Context initContext = new javax.naming.InitialContext();
    javax.naming.Context envContext =
    (javax.naming.Context)initContext.lookup("java:/comp/env");
    javax.sql.DataSource ds = (javax.sql.DataSource)
    envContext.lookup("jdbc/Test");;
    Connection conn = ds.getConnection();
    .....

    This is the message error:
    java.sql.SQLException: No suitable driver


    I need your help?

    Thank you,
    CC
     
    cccc, May 13, 2004
    #1
    1. Advertising

  2. The Oracle driver is oracle.jdbc.OracleDriver, not a
    oracle.jdbc.driver.OracleDriver.

    cccc wrote:
    > Hi,
    > I try this exercise: JNDI in Tomcat + Oracle bad this non work.
    >
    > 1/3)
    > I copy a file ojdbc14.jar in /common/lib Tomcat folder
    >
    > 2/3)
    > I write in server.xml Tomcat file:
    > ....
    > ....
    > <Resource name="jdbc/Test" type="javax.sql.DataSource" scope= "Shareable"
    > auth="Container"/>
    > <ResourceParams name="jdbc/Test">
    > <parameter>
    > <name>user</name>
    > <value>oe</value>
    > </parameter>
    > <parameter>
    > <name>password</name>
    > <value>adminoe</value>
    > </parameter>
    > <parameter>
    > <name>driverClassName</name>
    > <value>oracle.jdbc.driver.OracleDriver</value>
    > </parameter>
    > <parameter>
    > <name>url</name>
    > <value>jdbc:eek:racle:thin:mad:192.168.1.100:1521:MYDB</value>
    > </parameter>
    > <parameter>
    > <name>maxActive</name>
    > <value>15</value>
    > </parameter>
    > <parameter><name>maxIdle</name>
    > <value>15</value>
    > </parameter>
    > </ResourceParams>
    > ....
    > ....
    >
    > 3/3)
    > I write in my java code:
    > ....
    > javax.naming.Context initContext = new javax.naming.InitialContext();
    > javax.naming.Context envContext =
    > (javax.naming.Context)initContext.lookup("java:/comp/env");
    > javax.sql.DataSource ds = (javax.sql.DataSource)
    > envContext.lookup("jdbc/Test");;
    > Connection conn = ds.getConnection();
    > ....
    >
    > This is the message error:
    > java.sql.SQLException: No suitable driver
    >
    >
    > I need your help?
    >
    > Thank you,
    > CC
    >
    >
    >
    >
    >
    >
     
    Igor N. Kolomiyets, May 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darryl L. Pierce

    JNDI from Tomcat

    Darryl L. Pierce, Aug 6, 2004, in forum: Java
    Replies:
    2
    Views:
    649
    Darryl L. Pierce
    Aug 12, 2004
  2. Thomas Bauer

    Using JNDI Resources in Tomcat

    Thomas Bauer, Aug 20, 2004, in forum: Java
    Replies:
    1
    Views:
    6,465
    Juha Laiho
    Aug 20, 2004
  3. Mike S
    Replies:
    0
    Views:
    23,108
    Mike S
    Sep 16, 2004
  4. Mick
    Replies:
    2
    Views:
    9,671
    Marcin Grunwald
    Feb 23, 2005
  5. Feyruz
    Replies:
    4
    Views:
    2,349
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page