tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaime Garcia Bonis <jai...@afina.es>
Subject JNDI question
Date Thu, 25 Oct 2001 09:45:46 GMT
Hi evryone

    I have a question about how JNDI works in Tomcat 4.0.1
    How can i set up a JNDI naming repository in order to create a
datasource???

    In the server.xml i have this:

         <Resource name="jdbc/FtcAppDb" auth="CONTAINER"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/FtcAppDb">
            <parameter><name>user</name><value>scott</value></parameter>


<parameter><name>password</name><value>tiger</value></parameter>
            <parameter><name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value></parameter>

            <parameter><name>driverName</name>

<value>jdbc:oracle:thin:@zagarron:1521:orcl</value></parameter>
          </ResourceParams>

        Inside de Context tag of my application.

        In the web.xml i have this:

        <resource-ref>
      <res-ref-name>jdbc/FtcAppDb</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
 <res-auth>Container</res-auth>
    </resource-ref>

i get the datasource object doing this :DataSource ds =
(DataSource)ctx.lookup("jdbc/FtcAppDb");
but when i try to create the connection object i get a Null Pointer
exception error

Could anyone help me i don't have a clue about what happen.

Thanks for the time

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message