Configuring a Direct Connection

To configure Tomcat Server using Direct Connection for the integration with Secret Server or with the Delinea Platform, perform the following tasks:

  1. Configure the Class Name of the JDBC Proxy Driver

  2. Configuring a Direct Connection in the Application Configuration File

Step 1: Configuring the Class Name of the JDBC Proxy Driver

To support the Delinea JDBC Proxy driver for your application, modify the application configuration file according to the following connection string and driver class.

Connection String

Database Connection String Delinea Driver Connection String
MYSQL jdbc:mysql://localhost:port/databaseName jdbc:delinea:SSID:mysql://localhost:port/databaseName
SQLSERVER jdbc:sqlserver://localhost:port;databaseName=databaseName jdbc:delinea:SSID:sqlserver://localhost:port;databaseName=databaseName
Oracle jdbc:oracle:thin:@localhost:port:databaseName jdbc:delinea:SSID:oracle:thin:@localhost:port:databaseName
Apache Derby jdbc:derby://localhost:port/database jdbc:delinea:SSID:derby://localhost:port/database

Driver Class

Database Native Driver Class Proxy Driver Class
ANY com.mysql.jdbc.Driver com.delinea.jdbc.DelineaDriver

The Delinea driver class name remains the same across databases (MySQL, SQL Server, Oracle, Apache Derby).

Optional: If you want to add an auto comment, first you need to enable it on the secret, and then append the comment value after the SSID in the Delinea Driver connection string using the following format:

Copy
jdbc:delinea:SSID:comment:mysql://localhost:port/databaseName
SSID = Secret ID
comment = any comment

Step 2: Configuring a Direct Connection in the Application Configuration File

Navigate to the directory where the application is deployed: C:\Program Files\Apache Software Foundation\Tomcat 10.1\webapps

Edit the application configuration file. The format may vary (.txt, .xml, .properties, or .config).

Below is an example of a Java JPA application configured with multiple DataSources Required Configuration Changes update only the following database connection parameters:

  • Connection URL

    • Update the URL property with the Delinea connection string: jdbc:delinea:SSID:mysql://localhost:3306/databaseName

    • If you have any comments for the Secret, please add them after the SSID:

       jdbc:delinea:SSID:comment:mysql://localhost:port/databaseName

  • Driver Class

    • Update the Driver property with the Delinea driver class name: com.delinea.jdbc.DelineaDriver

Parameter names and structure may differ depending on the application and configuration file type. A sample configuration is shown below.

Copy
    <persistence-unit name="PersistenceUnit1" transaction-type="RESOURCE_LOCAL">
        <class>com.jpa.entity.Book</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/databaseName"/>
            <property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
            <property name="javax.persistence.jdbc.user" value="XXXX"/>
            <property name="javax.persistence.jdbc.password" value="XXXX"/>
       </properties>
     </persistence-unit>
    <persistence-unit name="PersistenceUnit2" transaction-type="RESOURCE_LOCAL">
        <class>com.jpa.entity.Student</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/databaseName"/>
            <property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
            <property name="javax.persistence.jdbc.user" value="XXXX"/>
            <property name="javax.persistence.jdbc.password" value="XXXX"/>
       </properties>
     </persistence-unit>

        

The modified file looks like the following:

Copy
<persistence-unit name="PersistenceUnit2" transaction-type="RESOURCE_LOCAL">
        <class>com.jpa.entity.Student</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:deline:SSID:mysql://localhost:3306/databaseName"/>
            <property name="javax.persistence.jdbc.driver" value="com.delinea.jdbc.DelineaDriver"/>
       </properties>
     </persistence-unit>

    <persistence-unit name="PersistenceUnit2" transaction-type="RESOURCE_LOCAL">
        <class>com.jpa.entity.Student</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:deline:SSID:mysql://localhost:3306/databaseName"/>
            <property name="javax.persistence.jdbc.driver" value="com.delinea.jdbc.DelineaDriver"/>
       </properties>
     </persistence-unit>
  • The file has connection details for two databases, and the current configuration file contains a username, password, URL, and driver class name. The configuration file URL parameter will modify with the Delinea connection string add suffix delinea:SSID and driver parameter with Delinea driver class name com.delinea.jdbc.DelineaDriver. The username and password parameter are not needed.

  • Save and refresh the application.