tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lindomar" <lindomar.si...@bol.com.br>
Subject Re: Datasource
Date Mon, 30 Sep 2002 19:16:32 GMT
Hi Miguel, thanks for your help...

I placed this code in web.xml, but don't work yet.
***
resource-ref>
     <description>My datasource</description>
     <res-ref-name>myjndi</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
</resource-ref>
***
I searched something about this, and is exactly this procedure.
I checked the  server.xml and web.xml files, they are ok.
Server.xml
####
...
          <Resource name="myjndi" scope="Shareable"
type="javax.sql.DataSource"/>
          <ResourceParams name="myjndi">
            <parameter>
              <name>validationQuery</name>
              <value></value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:db2:mydatabase</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>mypasswd</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>4</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>10</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>COM.ibm.db2.jdbc.app.DB2Driver</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>myuser</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>2</value>
            </parameter>
          </ResourceParams>
...
###


----- Original Message -----
From: "Miguel Angel Mulero Martinez" <miguel-angel.mulero@mad.tecsidel.es>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Monday, September 30, 2002 11:27 AM
Subject: RE: Datasource


> You must define the DataSource in your web.xml too. For example:
>
>   <resource-ref>
>     <description>My datasource</description>
>     <res-ref-name>myjndi</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>
> Regards.
>
> -----Mensaje original-----
> De: Lindomar [mailto:lindomar.silva@bol.com.br]
> Enviado el: domingo, 29 de septiembre de 2002 20:41
> Para: Tomcat Users List
> Asunto: Datasource
>
> Hi everybody!
> I'm using this code for connect my app in tomcat 4.1:
> $$$$$$$$
> ...
> Connection conn = null;
>     InitialContext ic = new InitialContext();
>     DataSource ds = (DataSource)ic.lookup("myjndi")
>      conn = ds.getConnection();
> ...
> $$$$$$$$$
> I configurate my connection in Adminitration Tool of tomcat.
> For JNDI Name i set to "myjndi"
>
> Until here ok, but when i start my app, appears exception:
> Name myjndi is not bound in this Context
>
> Any idea for this problem?
>
> Thanks in advanced.
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message