Defining a Data Source that Uses the Delinea JDBC Proxy Driver

Create a configuration for a data source that uses the Delinea JDBC Proxy Driver in the standalone.xml file. The standalone.xml flie is located in JBOSS_HOME/standalone/configuration.

JBOSS_HOME is the reference to the JBOSS_HOME system variable in Windows that specifies the path of the JBoss installation folder.

Example Application Configuration

  1. Add a data source configuration to the standalone.xml file and update <connection-url> to reflect the correct database connection string according to the Native JDBC driver requirements.

    The following example configuration defines ExampleBook and ExampleStudent data sources. ExampleBook is the JNDI name for a sample Book database, and ExampleStudent is the JNDI name for a Student database.

    Copy
    <datasources>
                    <datasource jndi-name="java:jboss/ExampleBook" pool-name="delineaDS1" enabled="true" use-java-context="true">
                        <connection-url>jdbc:delinea:SSID:mysql://localhost:3306/DBName</connection-url>
                        <driver>delinea</driver>
                    </datasource>
                    <datasource jndi-name="java:jboss/ExampleStudent" pool-name="delineaDS2" enabled="true" use-java-context="true">
                        <connection-url>jdbc:delinea:SSID:mysql://localhost:3306/DBName</connection-url>
                        <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>
    • In <connection-url> replace SSID with your Secret Server identifier and DBName with your database name. Below is an example of the connection string for a MySQL database:

      <connection-url>jdbc:delinea:10382:mysql://localhost:3306/sampleapp</connection-url>

    • Ensure that the com.delinea and com.mysql modules are correctly configured in JBoss Server.

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

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

    • Refer to the Tomcat Configuration Documentation for additional class name configuration details.

     

  2. When you finish configuring the data sources, restart JBoss Server.

Below is an example of a Java JPA application configuration that references the ExampleBook and ExampleStudent data sources from the example above:

Copy
<persistence-unit name="proxyDriver1" transaction-type="RESOURCE_LOCAL">
        <non-jta-data-source>java:jboss/ExampleBook</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/ExampleStudent</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.