Configuring JBoss Server

To configure the JBoss Server, complete the following steps:

Step 1: Creating a Module for the Delinea JDBC Driver

Create a module for the Delinea JDBC Driver to integrate with Secret Server or with the Delinea Platform:

  1. Create the folder structure, such as JBOSS_HOME/modules/com/delinea/main.

    JBOSS_HOME refers to the path of the JBoss installation folder on your machine.

  2. Copy the required files:

    1. Run the SetUpUtility tool (described in Running the SetUpUtility).
    2. When prompted for the deployed application lib folder path, provide JBOSS_HOME/modules/com/delinea/main. SetUpUtility will automatically copy the delinea-jdbc-driver.jar and DelineaDriver.properties files to the JBOSS_HOME/modules/com/delinea/main folder.
    3. Create a module.xml file in the main folder and include the Delinea driver module and its dependencies with the following content:
  3. Copy
    <module xmlns="urn:jboss:module:1.1" name="com.delinea">
    <resources>
    <resource-root path="delinea-jdbc-driver.jar"/>
    </resources>
    <dependencies>
    <module name="com.mysql"/>
    <module name="javax.api"/>
    </dependencies>
    </module>

    Add the Native Driver modules to the <dependencies> section in module.xml so that the native JDBC driver module is included as a dependency for the Delinea JDBC driver module. In the example above, the Native Driver module is added for My SQL.

  4. Define the Delinea JDBC Driver in standalone.xml:

    In JBOSS_HOME/standalone/configuration/standalone.xml, define the Delinea driver under the <datasources> section:

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

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

Step 2: 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 refers to the path of the JBoss installation folder on your machine.

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 ID 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.