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" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]]
> 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:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>