Configuring a Data Source Connection
This section provides the high-level steps to configure a data source connection (Non-XA or XA DataSource) to the database for your application, using the Delinea JDBC Proxy Driver.
Important: Data Source connections are separate from Direct connections. If you need to configure a Direct connection instead, see Configuring a Direct Connection.
Data Source Connection Types
There are two types of server-managed data source connections:
- Non-XA DataSource - For standard single database transactions (most common use case). Uses non-JTA data sources.
- XA DataSource - For distributed transactions involving multiple databases, JMS, or other resources requiring two-phase commit. Uses JTA data sources.
Choose the type that matches your application's transaction requirements. Each type has different configuration steps as outlined below.
Configuring Non-XA DataSource Connection
Follow these steps to configure a Non-XA DataSource connection for single database transactions:
-
Step 1: Run the Setup Utility on the server. When prompted, provide the path of the lib folder for your deployed web application.
The Setup Utility will copy the Delinea-Jdbc-Proxy.jar and delineadriver.properties file to that location after successful setup. This step is required for all connection types. For detailed instructions on running the Setup Utility, see Running the Setup Utility.
-
Step 2: Configure Non-XA DataSource in Tomcat
- Add a Resource definition in context.xml or server.xml.
- Configure the DataSource with a JNDI name (for example, jdbc/MyDS)..
- Set the native database connection properties.
- Set the Delinea custom connection properties.
-
Step 3: Configure the Non-XA DataSource connection in your application configuration file
Use the JNDI name you created in Step 2. For example:
<non-jta-data-source>java:comp/env/jdbc/MyDS</non-jta-data-source>Note: In Tomcat, JNDI resources are accessed using the
java:comp/env/prefix.
Configuring XA DataSource Connection
Follow these steps to configure an XA DataSource connection for distributed transactions:
-
Step 1: Run the Setup Utility on the server. When prompted, provide the path of the lib folder for your deployed web application.
The Setup Utility will copy the Delinea-Jdbc-Proxy.jar and delineadriver.properties file to that location after successful setup. This step is required for all connection types. For detailed instructions on running the Setup Utility, see Running the Setup Utility.
-
Step 2: Configure XA DataSource in Tomcat
- Add a Resource definition in context.xml or server.xml
- Specify the Delinea JDBC Proxy Driver XA factory class
- Configure the XA DataSource with a JNDI name (for example, jdbc/MyXADS)
- Set the native database XA connection properties
- Set the Delinea custom connection properties.
Note: XA DataSource configuration in Tomcat may require additional transaction manager libraries such as Atomikos or Bitronix.
-
Step 3: Configure the XA DataSource connection in your application configuration file
Use the JNDI name you created in Step 2. For example:
<jta-data-source>java:comp/env/jdbc/MyXADS</jta-data-source>Note: In Tomcat, JNDI resources are accessed using the
java:comp/env/prefix.
Key Differences Between Non-XA and XA DataSource
| Aspect | Non-XA DataSource | XA DataSource |
|---|---|---|
| Transaction Type | Single database (local) | Distributed (2-phase commit) |
| DataSource Type | Standard DataSource | XA DataSource |
| Configuration Tag | <non-jta-data-source> | <jta-data-source> |
| Configuration File | context.xml or server.xml | context.xml or server.xml |
| JNDI Lookup | java:comp/env/jdbc/MyDS | java:comp/env/jdbc/MyXADS |
| Use Case | Most applications | Multiple databases/JMS resources |
Note: The server manages connection pooling for data source connections, which provides better performance compared to direct connections.