tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "v.siguier" <v.sigu...@voila.fr>
Subject JNDI + oracle + Tomcat
Date Mon, 04 Aug 2003 09:06:51 GMT
Hello,

I try to connect to Oracle 8.1.7 using a DataSource (Tomcat 4.1.24).
In the code, my datasource object is not null (Oracle driver have been founded) but on getConnection
method I have the 
following error message :

java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver'
for connect URL 'null'


Following is server.xml part :
                       --------------
<ResourceParams name="jdbc/app/geode">
          <parameter>
                   <name>user</name>
                   <value>user</value>
          </parameter>
          <parameter>
                   <name>password</name>
                   <value>password</value>
          </parameter>
          <parameter>
                   <name>driverClassName</name>
                   <value>oracle.jdbc.driver.OracleDriver</value>
          </parameter>
          <parameter>
                   <name>driverName</name>
                   <value>jdbc:oracle:thin:@xxxxxxxx:1521:xxxxxx</value>
          </parameter>
</ResourceParams>

Following is web.xml part :
                       -----------
<resource-ref>
          <description>gfds</description>
          <res-ref-name>jdbc/app/geode</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
</resource-ref>

Following is my code to obtain a connection :
Context envGlobal = new InitialContext();
Context envApp = (Context)envGlobal.lookup("java:comp/env");
DataSource m_oJdbcDataSource = ( DataSource )envApp.lookup("jdbc/app/geode");
Connection l_connect = m_oJdbcDataSource.getConnection();

I don't understand why connect URL is null, somebody can help me ?
Thank you.
------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr 



Mime
View raw message