# 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=sqljdbc4.jar, driver-class=com.microsoft.jdbc.sqlserver.SQLServerDriver, connection-url=jdbc:microsoft:sqlserver://{host}:1433, user-name={user}, password={password})

# XA Data source
#batch
#/subsystem=datasources/xa-data-source=sqlserverDS:add(jndi-name=java:/sqlserverDS,  driver-name=sqljdbc4.jar, xa-datasource-class=com.microsoft.sqlserver.jdbc.SQLServerXADataSource, 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=.." 