9 Replies Latest reply on Dec 13, 2010 4:27 AM by johnstok -

    How can I set an Oracle XA datasource property from my -ds.xml file?

    johnstok - Newbie

      I need to set a property on my Oracle data source. However, I can't see how to do this via my -ds.xml file.

       

      In code I am doing the following:

      final OracleXADataSource ods = new OracleXADataSource();
                  ods.setPassword(password);
                  ods.setUser(username);
                  ods.setURL(url);
                  final Properties connectionProps = new Properties();
                  connectionProps.put(
                      "oracle.jdbc.RetainV9LongBindBehavior", "true");
                  ods.setConnectionProperties(connectionProps);
      final OracleXADataSource ods = new OracleXADataSource();
      ods.setPassword(password);
      ods.setUser(username);
      ods.setURL(url);
      final Properties connectionProps = new Properties();
      connectionProps.put("oracle.jdbc.RetainV9LongBindBehavior", "true");
      ods.setConnectionProperties(connectionProps);
      

       

      My current datasource file looks like this:

        <xa-datasource>
      
          <jndi-name>${application.prefix}</jndi-name>
          <xa-datasource-property name="URL">${ccc.db.connection.url}</xa-datasource-property>
          <xa-datasource-class>${ccc.db.datasource}</xa-datasource-class>
          <user-name>${application.db-username}</user-name>
          <password>${application.db-password}</password>
      
          <max-pool-size>100</max-pool-size>
          <exception-sorter-class-name>${ccc.db.exc-sorter}</exception-sorter-class-name>
      
        </xa-datasource>
      

       

      I tried the "xa-datasource-property" element but this doesn't seem to work - my understanding is that this will try to find a JavaBean setter, which doesn't exist.