6.4. XA Datasources
6.4.1. Create an XA Datasource with the Management Interfaces
This topic covers the steps required to create an XA datasource, using either the Management Console or the Management CLI.
Prerequisites
Note
Procedure 6.7. Create an XA Datasource, Using Either the Management CLI or the Management Console
Management CLI
- Run the following command to create an XA datasource, configuring the variables as appropriate:
xa-data-source add --name=XA_DATASOURCE_NAME --jndi-name=JNDI_NAME --driver-name=DRIVER_NAME --xa-datasource-class=XA_DATASOURCE_CLASS
Configure the XA datasource properties
Set the server name
Run the following command to configure the server name for the host:/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=ServerName:add(value=HOSTNAME)
Set the database name
Run the following command to configure the database name:/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=DatabaseName:add(value=DATABASE_NAME)
- Enable the datasource:
xa-data-source enable --name=XA_DATASOURCE_NAME
Management Console
Navigate to the Datasources panel in the Management Console
Standalone Mode
Select the Profile tab from the top-right of the console.Domain Mode
- Select the Profiles tab from the top-right of the console.
- Select the appropriate profile from the drop-down box in the top left.
- Expand themenu on the left of the console.
- Select→ from the menu on the left of the console.
Figure 6.4. Datasources panel
- Select the XA Datasource panel.
Create a new XA datasource
- Select the XA Datasources panel.button at the top of the
- Enter the new XA datasource attributes in the Create XA Datasource wizard and proceed with the button.
- Enter the JDBC driver details in the Create XA Datasource wizard and proceed with the button.
- Edit the XA properties and proceed with thebutton.
- Enter the connection settings in the Create XA Datasource wizard and select the button.
The XA datasource has been added to the server. It is now visible in either the standalone.xml
or domain.xml
file, as well as the management interfaces.
- To configure the datasource further, refer here: Section 6.4.2, “Modify an XA Datasource with the Management Interfaces”.
- To remove the datasource, refer here: Section 6.4.3, “Remove an XA Datasource with the Management Interfaces”.