Datasources
This is a list of handy datasource commands that can be issued using the datasource alias:
- Add a datasource:
data-source add --jndi-name=java:/MySqlDS --name=MySQLPool --connection-url=jdbc:mysql://localhost:3306/MyDB --driver-name=mysql-connector-java-5.1.16-bin.jar --user-name=myuser --password=password –max-pool-size=30
- Remove a datasource:
data-source remove --name=java:/MySqlDS
Datasources (using operations on resources)
You can also operate on a datasource using operations on the data sources subsystem:
- List the installed drivers:
/subsystem=datasources:installed-drivers-list
- Add a datasource:
data-source add --jndi-name=java:/MySqlDS --name=MySQLPool --connection-url=jdbc:mysql://localhost:3306/MyDB --driver-name=mysql-connector-java-5.1.30-bin.jar --user-name=myuser --password=password --max-pool-size=30
- Add an XA datasource (using an operation):
xa-data-source add --name=MySQLPoolXA --jndi-name=java:/MySqlDSXA --driver-name=mysql-connector-java-5.1.30-bin.jar -xa-datasource...