<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  JBoss Server Configuration                                           -->
<!-- Thanks to kosulin in the forumns                                      -->
<!-- ===================================================================== -->

<!-- $Id: db2-xa-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->

<datasources>

   <!--
      TODO: add driver name, version and download url here
   -->

   <!--
      The example posted in the forums uses a security domain. What is the user/password xa-datasource-property?
      try javap com.sybase.jdbc3.jdbc.SybXADataSource 
      For the security domain. Add something like the following to conf/login-config.xml

      <application-policy name = "SybaseXADSRealm">
         <login-module code = "org.jboss.resource.security.SecureIdentityLoginModule" flag = "required">
            <module-option name = "username">myuser</module-option>
            <module-option name = "password">myhash</module-option>
            <module-option name = "managedConnectionFactoryName">jboss.jca:service=XATxCM,name=SybaseXADS</module-option>
         </login-module>
      </application-policy>
   -->

   <xa-datasource>
     <jndi-name>SybaseXADS</jndi-name>
     <track-connection-by-tx/>
     <xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
     <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
     <xa-datasource-property name="ServerName">myserver</xa-datasource-property>
     <xa-datasource-property name="PortNumber">4100</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">mydatabase</xa-datasource-property>
     <!-- Use the security domain defined in conf/login-config.xml -->
     <security-domain>SybaseXADSRealm</security-domain>
     <min-pool-size>1</min-pool-size>
     <max-pool-size>20</max-pool-size>
     <idle-timeout-minutes>15</idle-timeout-minutes>
     <check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql>
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
     <type-mapping>Sybase</type-mapping>

   </xa-datasource>

</datasources>
