Hi everyone...
I'm trying to access the DataSource using res-ref-name like

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

But I think I'm getting a different connect coz the table i'm trying to
query is not available.

Here's my descriptor... can you please check what's wrong

ejb-jar.xml
<ejb-jar>
  <description>jBoss test application </description>
  <display-name>Test</display-name>
  <enterprise-beans>
    <session>
      <ejb-name>Interest</ejb-name>
      <home>com.web_tomorrow.interest.InterestHome</home>
      <remote>com.web_tomorrow.interest.Interest</remote>
      <ejb-class>com.web_tomorrow.interest.InterestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <resource-ref>
          <res-ref-name>jdbc/CatalystDS</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>
    </session>
  </enterprise-beans>
</ejb-jar>


jboss.xml
<?xml version="1.0" encoding="Cp1252"?>

<jboss>
  <secure>false</secure>
  <container-configurations />
  <resource-managers />
  <enterprise-beans>
     <session>
       <ejb-name>Interest</ejb-name>
       <jndi-name>interest/Interest</jndi-name>
       <configuration-name></configuration-name>

        <resource-ref>
            <res-ref-name>jdbc/CatalystDS</res-ref-name>
            <resource-name>CatalystDS</resource-name> <!-- In weblogic, this
is a jndi name. -->
        </resource-ref>

      <resource-managers>
        <resource-manager>
          <res-name>CatalystDS</res-name>
          <res-jndi-name>java:/CatalystDS</res-jndi-name>
        </resource-manager>
      </resource-managers>


     </session>
  </enterprise-beans>
</jboss>

I have successfully created a DataSource. In JBoss console, it prints that
CatalystDS is bound to java:/CatalystDS. Now, my question how do I link the
jdbc/CatalystDS to the CatalystDS. How do I specify the jndi name for the
data source? How do I specify the jndi name of the datasource?

Please help. Thanks in advance.

Jerson



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to