4 Replies Latest reply on Oct 9, 2002 1:22 PM by Alexey Loubyansky

    DataSource JNDI Cloudscape

    Gautam Mehta Newbie

      Hi All,

      Need help with how to get the cloudscape datasource from data access objects.

      I am using JBoss-2.4.0_Tomcat-3.2.3

      I have the following entry in jboss.jcml

      <!-- ==================================================================== -->
      <!-- JDBC -->
      <!-- ==================================================================== -->


      COM.cloudscape.core.RmiJdbcDriver




      PowerdbDS
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
      jdbc:rmi://localhost:1099/jdbc:cloudscape:powerdb;create=false
      sa

      true


      1200000
      10
      false
      false
      false
      true
      120000
      1800000
      false
      1.0
      0


      I am developing a storefront. My architecture is as follows

      JSP --> Front Controller Servlet --> Session Facade --> Data Access Objects (DAO) --> Cloudscape DB

      What I do right now is to get the DataSource in the session facade e.g.
      context.lookup("java:/PowerdbDS"), get the connection and pass it to each
      method that I call on the Data Access Object e.g. registerUser(Connection conn, ValueObject value).

      I think this is BAD way to do this ????

      Hence, I was thinking of doing the lookup in the Data Access Object.

      I have read in the JBOSS documentaion that connections form the pool are not available outside jboss !!!

      SO HOW DO I DO THE LOOKUP IN THE DAO FOR THE DATASOURCE DECLARED IN jboss.jcml ???

      Help would be appreciated very much from any Marc Fleurys out there .... Thanks in advance.

      G