# note that driver-name could be driver's module name if you went module approach.
/subsystem=datasources/data-source=sqlserverDS:add(jndi-name=java:/sqlserverDS,  driver-name=jtds-1.2.5.jar, driver-class=net.sourceforge.jtds.jdbc.Driver, connection-url=jdbc:jtds:sqlserver://{host}:1433/{database}, user-name={user}, password={password})

# XA Data source
#batch
#/subsystem=datasources/xa-data-source=sqlserverDS:add(jndi-name=java:/sqlserverDS,  driver-name=jtds-1.2.5.jar, xa-datasource-class=net.sourceforge.jtds.jdbcx.JtdsDataSource, user-name={user}, password={password})
#/subsystem=datasources/xa-data-source=sqlserverDS/xa-datasource-properties=DatabaseName:add(value={database_name})
#/subsystem=datasources/xa-data-source=sqlserverDS/xa-datasource-properties=PortNumber:add(value=1433)
#/subsystem=datasources/xa-data-source=sqlserverDS/xa-datasource-properties=ServerName:add(value={host})
#/subsystem=datasources/xa-data-source=sqlserverDS:enable
#run-batch


## If you are working in a clustered environment, prepend "/profile=ha" to all the above commands that start with "/subsystem=.." 