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]>

Reply via email to