How to specify different credentials for different connection urls in datasource ?

Solution Unverified - Updated -

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 4.x

Issue

  • How to specify different credentials(user-name and password for different connection urls) in one datasource ?

Resolution

This is verified by the schema definitions in the "jboss-eap-5.1.0/jboss-as/docs/schema/jboss-ds_5_0.xsd". (minOccurs="0" maxOccurs="1") one can use these tags "user-name" and "password" only once. So we cant set the different credentials for the databases.

  <xsd:group name="userGroup">
    <xsd:annotation>
      <xsd:documentation>
  user password group 
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="user-name"
         type="jboss:user-nameType"
         minOccurs="0"
         maxOccurs="1"/>
      <xsd:element name="password"
         type="jboss:passwordType"
         minOccurs="0"
         maxOccurs="1"/>
    </xsd:sequence>
  </xsd:group>  


This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.