1 Reply Latest reply on May 10, 2004 1:28 PM by adrian.brock

    Connecting to Hypersonic by DAO

    dyno64

      I am having trouble connecting to the Hypersonic database that comes with JBoss 3.2.1. The exception is: java.naming.NameNotFoundException: defaultDS not bound.

      Could someone tell me how I can make the connection work?

      -----------------In the DAO class----------------------

      DataSource ds;
      InitialContext c = null;
      c = new InitialContext();
      this.ds = (DataSource)c.lookup("java:comp/env/jdbc/defaultDS");

      ---------------- in ejb-jar.xml -------------------

      <session >
       <description>[CDATA[]]</description>
       <ejb-name>Test</ejb-name>
       <home>TestHome</home>
       <remote>Test</remote>
       <ejb-class>TestSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <resource-ref >
       <res-ref-name>jdbc/DefaultDS</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
      
       </session>
      ---------------- In jboss.xml ---------------

      <session>
       <ejb-name>Test</ejb-name>
       <jndi-name>TestBean</jndi-name>
       <resource-ref>
       <res-ref-name>jdbc/DefaultDS</res-ref-name>
       <jndi-name>java:/DefaultDS</jndi-name>
       </resource-ref>
       </session>