Configuring Non-XA DataSource Connection

Follow these steps to configure a Non-XA DataSource connection for single database transactions in JBoss Server using the Delinea JDBC Proxy Driver.

Before proceeding, ensure you have completed Step 1: Set Up JDBC Drivers as Modules in Configuring JBoss Web Server.

Non-XA DataSource Configuration Properties

The following properties are used in the Non-XA DataSource configuration. Property names are case-sensitive and must be specified exactly as shown.

Property Description
connection-url (Mandatory) Connection URL. Add the prefix delinea: after jdbc:.
delinea_secretId (Mandatory) The secret ID that contains database credentials.
delinea_vendorClass (Mandatory) The vendor driver class used to retrieve the connection.

Examples:
  • com.mysql.cj.jdbc.Driver
  • oracle.jdbc.OracleDriver
delinea_comment (Optional) Add this property only if autoComment is enabled on the secret.

All delinea_* parameters must be defined as <connection-property> elements within the <datasource> block.

Step 2: Configure Non-XA DataSource in standalone.xml

Add a Non-XA DataSource configuration to the standalone.xml file. The standalone.xml file is located in JBOSS_HOME/standalone/configuration.

Example Configuration

The following example defines DelineaNonXABookDS and DelineaNonXAStudentDS data sources. DelineaNonXABookDS is the JNDI name for a sample Book database, and DelineaNonXAStudentDS is the JNDI name for a Student database.

Copy
<datasources>
                <datasource jndi-name="java:jboss/DelineaNonXABookDS" pool-name="DelineaNonXABookDS">
                <connection-url>jdbc:delinea:mysql://localhost:3306/sampleapp</connection-url>
                <driver-class>com.delinea.jdbc.DelineaDriver</driver-class>
                <connection-property name="delinea_secretId">
                11336
                </connection-property>
                <connection-property name="delinea_vendorClass">
                com.mysql.cj.jdbc.Driver
                </connection-property>
                <driver>delinea</driver>
                </datasource>

                <datasource jndi-name="java:jboss/DelineaNonXAStudentDS" pool-name="DelineaNonXAStudentDS">
                <connection-url>jdbc:delinea:mysql://localhost:3306/sampleapp</connection-url>
                <driver-class>com.delinea.jdbc.DelineaDriver</driver-class>
                <connection-property name="delinea_secretId">
                11336
                </connection-property>
                <connection-property name="delinea_vendorClass">
                com.mysql.cj.jdbc.Driver
                </connection-property>
                <driver>delinea</driver>
                </datasource>

                <drivers>
                <driver name="delinea" module="com.delinea">
                <driver-class>com.delinea.jdbc.DelineaDriver</driver-class>
                </driver>
                <driver name="mysql" module="com.mysql">
                <driver-class>com.mysql.cj.jdbc.Driver</driver-class>
                </driver>
                </drivers>
            </datasources>

Important notes:

  • In <connection-url>, replace the database host, port, and database name with your actual values. The secret ID is specified via the delinea_secretId connection property, not in the URL.

  • Ensure that the com.delinea and com.mysql modules are correctly configured in JBoss Server (see Step 1 in Configuring JBoss Web Server).

  • Verify that the JNDI names (in this example, java:jboss/DelineaNonXABookDS and java:jboss/DelineaNonXAStudentDS) match your application's requirements.

You can also add data sources and drivers through the JBoss UI: JBoss > Configuration > Subsystems > Datasources & Drivers.

Step 3: Configure the Application Configuration File

Update your application's configuration file (e.g., persistence.xml) to reference the JNDI names defined in Step 2.

For Non-XA DataSources, use <non-jta-data-source> with transaction-type="RESOURCE_LOCAL":

Copy
<persistence-unit name="proxyDriver1" transaction-type="RESOURCE_LOCAL">
                <non-jta-data-source>java:jboss/DelineaNonXABookDS</non-jta-data-source>
                <class>com.jpa.demo.Book</class>
                <properties>
                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
                </properties>
                </persistence-unit>

                <persistence-unit name="proxyDriver2" transaction-type="RESOURCE_LOCAL">
                <non-jta-data-source>java:jboss/DelineaNonXAStudentDS</non-jta-data-source>
                <class>com.jpa.demo.Student</class>
                <properties>
                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
                </properties>
            </persistence-unit>

The format of the application configuration file can vary. It can be a .txt, .xml, .properties, or .config file.

After updating the application configuration, restart JBoss Server to apply the changes.

Verification

To verify the integration is working correctly, see JBoss Server Integration Verification.