Configuring a Direct Connection
To configure a direct connection to the database for your Java application using the Delinea JDBC Proxy Driver, you must perform the following tasks:
-
Configure the class name of the Delinea JDBC Proxy Driver.
-
Configure a direct connection in the application configuration file.
-
Set up the native driver classpath.
Configuring the Class Name of the JDBC Proxy Driver
You must modify the application configuration file with the following connection string:
Database | Database Connection String | Delinea Driver Connection String |
---|---|---|
MYSQL | Jdbc:mysql://localhost:port/database | jdbc:delinea:SSID:mysql://localhost:port/database |
SQLSERVER | jdbc:sqlserver://localhost:port;databaseName= database | jdbc:delinea:SSID:sqlserver://localhost:port;databaseName= database |
Oracle | jdbc:oracle:thin:@localhost:port: database | jdbc:delinea:SSID:oracle:thin:@localhost:port: database |
Apache Derby | :derby://localhost:port/database | jdbc:delinea:SSID:derby://localhost:port/database |
SSID refers to the secret ID in Secret Server.
Driver Class
Database Class | Delinea Driver class name | |
---|---|---|
ANY | com.mysql.jdbc.Driver | com.delinea.jdbc.DelineaDriver |
This example shows the driver class of the Delinea JDBC Proxy Driver for MySQL. The class name is the same for SQL Server, Oracle, and Apache Derby.
If your application uses the JNDI name in the application’s configuration file and uses a data source connection, use the following implementation class name of the JDBC Proxy Driver:
Database | Implementation class name |
---|---|
ANY | com.delinea.jdbc.DelineaConnectionPoolDataSource |
Create a new JDBC provider and a data source for the Delinea JDBC Proxy Driver.
Configuring a Direct Connection in the Application Configuration File
-
Go to the folder where your installed application is located in WebSphere Server, for example, C:\ProgramFiles\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WebSphereServerNode01Cell.
-
Open the configuration file.
The application configuration file name extension can vary. It can be a file with the * .txt, *.xml, *. properties, or *.config extension.
-
Make the following changes in the configuration file:
jdbc.user
. Remove this property.jdbc.password
. Remove this property.jdbc.url
: This parameter contains the connection string of the database. Add delinea:SSID to the beginning of the connection string. For example, the connection string for SQL Server isjdbc:delinea:SSID:sqlserver://localhost:PortNumber;databaseName=databaseName
.SSID refers to the ID of a secret in Secret Server.
jdbc.driver
: Replace the current value of this parameter with the com.delinea.jdbc.DelineaDriver class name of the Delinea JDBC Proxy Driver.
-
Save the changes in the file and restart your application.
See an example of how to configure a direct connection in the application configuration file.
Example: Configuring a Direct Connection in the Application Configuration File
The following is an example of the configuration file for a Java JPA application. The configuration file contains the following details for connecting to two databases:
-
Username
-
Password
-
Connection string
-
Driver class name
The configuration file looks like the following:
Modify the configuration file so that it looks like the following:
-
javax.persistence.jdbc.url
: Add the suffix delinea:SSID to the beginning of the connection string, as shown above. -
javax.persistence.jdbc.driver
: Replace the value of this parameter with the com.delinea.jdbc.DelineaDriver class name of the Delinea JDBC Proxy Driver. -
javax.persistence.jdbc.user
andjavax.persistence.jdbc.password
: These parameters are not needed, so remove them.
Setting Up the Native Driver Classpath
Update the native driver path in the WebSphere Application Server administrative console so that the Delinea JDBC Proxy Driver can directly call the native driver.
-
In the administrative console, navigate Servers > Server Types > WebSphere application Servers > server1.
The Application Server Configuration page opens.
-
Under Server Infrastructure, navigate to Java and Process Management > Process definition.
-
Under Additional Properties, select Java Virtual Machine.
-
Provide the JDBC driver path of the native driver (for example, SQL Server) and then select Apply and Save.
-
Restart WebSphere Application Server and test your application with the Delinea JDBC Proxy Driver.