3 Replies Latest reply on Nov 21, 2007 3:50 PM by Mark Little

    Registering Datasources in the TransactionalDriver without u

    Breako Beats Newbie

      Hi,
      Is it possible to register Datasources in the TransactionalDriver without using JNDI?
      I see there is a dynamic class mechanism but this method is no longer recommended>?

      I tried:

      Properties props = new Properties();
      props.setProperty(TransactionalDriver.userName, "user");
      props.setProperty(TransactionalDriver.password, "password");
      
      TransactionalDriver arjunaDriver = new TransactionalDriver();
      Connection conn = arjunaDriver.connect("jdbc:oracle:thin:@xxxx:yyy:ora10g",
       props);
      
      


      But conn ( the connection reference) ends up being null.

      I have also tried

      Connection conn = arjunaDriver.connect("jdbc:arjuna:jdbc:oracle:thin:@xxxx:yyy:ora10g",
       props);
      


      But that gives...

      java.sql.SQLException: [com.arjuna.ats.internal.jdbc.jndierror] Could not resolve JNDI XADataSource
       at com.arjuna.ats.internal.jdbc.IndirectRecoverableConnection.createDataSource(IndirectRecoverableConnection.java:428)
       at com.arjuna.ats.internal.jdbc.IndirectRecoverableConnection.<init>(IndirectRecoverableConnection.java:133)
       at com.arjuna.ats.internal.jdbc.ConnectionImple.<init>(ConnectionImple.java:100)
      
      



        • 1. Re: Registering Datasources in the TransactionalDriver witho
          Mark Little Master

          The dynamic approach is still there but not recommended simply because it relies on specific versions of drivers. You could leverage it again and update the code yourself if necessary.

          • 2. Re: Registering Datasources in the TransactionalDriver witho
            Breako Beats Newbie

             

            "mark.little@jboss.com" wrote:
            The dynamic approach is still there but not recommended simply because it relies on specific versions of drivers. You could leverage it again and update the code yourself if necessary.

            Thanks. Any chance of more info please?

            According to the programmers guide pg 31 using dynamic drivers not recommended.

            Also, in this posts you do not recommend using it:

            1.
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=96210
            2.
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88103

            Note - in this thread it says that support for Oracle 8 has been removed. So I can't see any other way for doing it for Oracle other than JNDI.

            I am using Oracle 10, is there any other way of doing it for Oracle 10?

            Note when I try using the JBoss App Server, by doing:

             props.setProperty(TransactionalDriver.dynamicClass, "com.arjuna.ats.internal.jdbc.drivers.oracle_8_1_6");
            


            - I get

            java.sql.SQLException: java.sql.SQLException: java.lang.ClassNotFoundException: com.arjuna.ats.internal.jdbc.drivers.sequelink_5_0
             at com.arjuna.ats.internal.jdbc.DirectRecoverableConnection.getConnection(DirectRecoverableConnection.java:311)
             at com.arjuna.ats.internal.jdbc.ConnectionImple.getConnection(ConnectionImple.java:584)
             at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:668)
             at com.arjuna.ats.internal.jdbc.ConnectionImple.createStatement(ConnectionImple.java:161)
            


            Regards




            • 3. Re: Registering Datasources in the TransactionalDriver witho
              Mark Little Master

              Take a look at the existing dynamic-related code and use that as a template.