1 Reply Latest reply on Jun 19, 2003 9:03 AM by Jon Barnett

    jndi datasource not found?

    maomao1234 Newbie

      i am use jboss-3.0_tomcat-4.1 . after deployed, running, system post error :
      jndi datasource not found?
      code below:
      //ctx is initContext object.
      Datasource ds = (DataSource)ctx.lookup("java:comp/jdbc/DataSource");
      how to write "java:comp/jdbc/DataSource" ???
      i am using Sybase 11.5 Database and using jconnect5.5 .
      please help me ,and glad to any hint . thanks

        • 1. Re: jndi datasource not found?
          Jon Barnett Master

          OK. Assume you have a datasource, sybase-ds.xml defined in the server/default/deploy directory of JBoss.
          <?xml version="1.0" encoding="UTF-8"?>

          <!-- ===================================================================== -->
          <!-- -->
          <!-- JBoss Server Configuration -->
          <!-- -->
          <!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver -->
          <!-- Thanks to Marc Zampetti <zampetti@aol.net> -->
          <!-- This is a minimal example. See the generic example for other stuff -->
          <!-- ===================================================================== -->

          <!-- $Id: sybase-ds.xml,v 1.1 2002/07/31 21:58:44 d_jencks Exp $ -->

          <!-- Sybase jConnect URL for the database.
          NOTE: The hostname and port are made up values. The optional
          database name is provided, as well as some additinal Driver

          The datasource connection is:
          Datasource ds = (DataSource)ctx.lookup("java:/jdbc/SybaseDB");

          You can also see your JNDI bindings in the JBoss jmx-console webapp, from the jndi-view link.