Create, configure, and test a MariaDB XA data source.
| Resources | |
|---|---|
| Files: |
/home/student/AD248/labs/datasources-xa
|
| Application URL: | N/A |
Outcomes
You should be able to create and test an XA data source based on the MariaDB driver.
Before beginning the guided exercise, run the following command to prepare the environment:
[student@workstation ~]$ lab start datasources-xa
Instructions
Start the standalone instance of JBoss EAP by running the following command, which uses /home/student/AD248/labs/datasources-xa/standalone as the base directory:
[student@workstation ~]$cd /opt/jboss-eap-7.4/bin[student@workstation bin]$./standalone.sh \-Djboss.server.base.dir=/home/student/AD248/labs/datasources-xa/standalone
Configure the XA JDBC driver.
Open a new terminal window, and run the following commands to connect to JBoss EAP by using the management CLI:
[student@workstation ~]$cd /opt/jboss-eap-7.4/bin[student@workstation bin]$./jboss-cli.sh --connect
Use the management to create the datasource with the following configuration:
Datasource name: MariaDBXADS
JNDI name: java:jboss/datasources/MariaDBXADS
driver name: mariadb
username: developer
password: redhat123
XA datasource property: Url=jdbc:mariadb://localhost:3306/lab_db
Run the following management CLI command to create the datasource:
[standalone@localhost:9990] xa-data-source add --name=MariaDBXADS \
--jndi-name=java:jboss/MariaDBXADS --driver-name=mariadb \
--user-name=developer --password=redhat123 \
--xa-datasource-properties={"Url"=>"jdbc:mariadb://localhost:3306/lab_db"}Note that this course uses the version 3.2 for the MariaDB JDBC driver which requires the Url datasource XA property.
Test the data source.
Navigate to http://localhost:9990 to access the management console page, using admin as username and redhat123 as the password.
Click to open the configuration page.
Navigate to . Click and open the drop-down menu to click .

JBoss EAP validates the datasource connection to the lab_db database and the management console shows a success message.

Clean up.
Exit the management CLI:
[standalone@localhost:9990] exitStop the JBoss EAP instance by pressing Ctrl+C in the terminal window that runs it.