# note that driver-name could be driver's module name if you went module approach.
/subsystem=datasources/data-source=mysqlDS:add(jndi-name=java:/mysqlDS,  driver-name=mysql-connector-java-5.1.5.jar, driver-class=com.mysql.jdbc.Driver, connection-url=jdbc:mysql://{host}:3306/{database}, user-name={user}, password={password})

# XA Data source
#batch
#/subsystem=datasources/xa-data-source=mysqlDS:add(jndi-name=java:/mysqlDS,  driver-name=mysql-connector-java-5.1.5.jar, xa-datasource-class=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource, user-name={user}, password={password})
#/subsystem=datasources/xa-data-source=mysqlDS/xa-datasource-properties=DatabaseName:add(value={database_name})
#/subsystem=datasources/xa-data-source=mysqlDS/xa-datasource-properties=PortNumber:add(value=3306)
#/subsystem=datasources/xa-data-source=mysqlDS/xa-datasource-properties=ServerName:add(value={host})
#/subsystem=datasources/xa-data-source=mysqlDS:enable
#run-batch


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