2 Replies Latest reply on Nov 3, 2005 9:59 AM by Francois Joubert

    Incorrect DataSource lookup

    Francois Joubert Newbie

      I am creating two datasources in a file named mssql-ds.xml as follows. The databases are on different servers, and have different names.

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>jdbc/one</jndi-name>
       <connection-url>jdbc:microsoft:sqlserver://myserver1:1433;DatabaseName=one</connection-url>
       <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
       <user-name>user</user-name>
       <password>password</password>
       </local-tx-datasource>
       <local-tx-datasource>
       <jndi-name>jdbc/two</jndi-name>
       <connection-url>jdbc:microsoft:sqlserver://myserver2:1433;DatabaseName=two</connection-url>
       <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
       <user-name>user</user-name>
       <password>password</password>
       </local-tx-datasource>
      </datasources>
      


      When I lookup "jdbc/one", the connection I get from the datasource is connected to "jdbc/two". When I remove the second data source definition from the mssql-ds.xml file, the connection is made to the correct database.