1 Reply Latest reply on Sep 29, 2004 2:15 PM by Tim Morrow

    External Hypersonic

    Jerry Payne Newbie

      I have been given a task of showing how to connect to an external database using JBoss. I am using a standalone version of Hypersonic. I have created a new hsqldb-ds.xml file that I think should be connecting to the external db.

       <type-mapping>Hypersonic SQL</type-mapping>
       <mbean code="org.jboss.jdbc.HypersonicDatabase"
       <attribute name="Port">1701</attribute>
       <attribute name="Silent">true</attribute>
       <attribute name="Database">default</attribute>
       <attribute name="Trace">false</attribute>
       <attribute name="No_system_exit">true</attribute>

      When I put a new version of this file in the default/deploy directory I get a message that the Datasource has been bound to the name 'java:HypersonicDS'.

      In my Java app I am connecting successfully to the naming service, but I get a NameNotFoundException when I try and access the JNDI name. I have tried several different versions. I am trying to get this to work before I deploy an Entity bean that uses the external Hypersonic database.

        • 1. Re: External Hypersonic
          Tim Morrow Newbie

          Define a resource reference in web.xml, then map that to the JBoss jndi name in jboss-web.xml and look it up (using the name defined in web.xml) from the container java:comp/env context.




          InitialContext ic = new InitialContext();
          DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/myDS");