Updated on 2026-09-24 GMT+08:00

Modifying Database Connection and Driver

To integrate an application with an encryption/decryption plugin, it is necessary to modify the database connection configuration file—primarily by updating the database driver file and the URL. This document explains how to configure the plugin across four key areas: the configuration file, middleware, the application, and the data source.

This configuration uses MySQL as an example; the URL configuration varies depending on the database type – please refer to the Data Source JDBC Configuration File for specific instructions.

The following examples—using YAML, Properties, and XML configuration files as illustrations—show how to modify configuration files when integrating plugins.

YAML

database:
#driverclass: com.MySQL.cj.jdbc.Driver
driverclass: com.pced.engine.spy.MaskingDriver
#url: jdbc:MySQL://localhost:3306/mydatabase
url: jdbc:masking:MySQL://localhost:3306/mydatabase
username: myuser
password: mypassword

Before modification:

driverclass: com.MySQL.cj.jdbc.Driver
url: jdbc:MySQL://localhost:3306/mydatabase

after modification:

driverclass: com.pced.engine.spy.MaskingDriver
url: jdbc:masking:MySQL://localhost:3306/mydatabase

Properties

#spring.datasource.driver-class-name=com.MySQL.cj.jdbc.Driver
spring.datasource.driver-class-name=com.pced.engine.spy.MaskingDriver #spring.datasource.url=jdbc:MySQL://localhost:3306/mydatabase?
useSSL=false&serverTimezone=UTC
spring.datasource.url=jdbc:masking:MySQL://localhost:3306/mydatabase? useSSL=false&serverTimezone=UTC
spring.datasource.username=myuser
spring.datasource.password=mypassword

Before modification:

spring.datasource.driver-class-name=com.MySQL.cj.jdbc.Driver url: spring.datasource.url=jdbc:MySQL://localhost:3306/mydatabase?
useSSL=false&serverTimezone=UTC

after modification:

spring.datasource.driver-class-name=com.pced.engine.spy.MaskingDriver
spring.datasource.url=jdbc:masking:MySQL://localhost:3306/mydatabase? useSSL=false&serverTimezone=UTC

XML

<!--Configure Data Source-->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<!-- <property name="driverClassName" value="com.MySQL.cj.jdbc.Driver"/> -->
<property name="driverClassName" value="com.pced.engine.spy.MaskingDriver"/>
<!-- <property name="url" value="jdbc:MySQL://localhost:3306/mydatabase?useSSL=false&serverTimezone=UTC"/> -->
<property name="url" value="jdbc:masking:MySQL://localhost:3306/mydatabase? useSSL=false&serverTimezone=UTC"/>
<property name="username" value="myuser"/>
<property name="password" value="mypassword"/> </bean>

Before modification:

<property name="driverClassName" value="com.MySQL.cj.jdbc.Driver"/>
<property name="url" value="jdbc:MySQL://localhost:3306/mydatabase?useSSL=false&serverTimezone=UTC"/>

after modification:

<property name="driverClassName" value="com.pced.engine.spy.MaskingDriver"/>
<property name="url" value="jdbc:masking:MySQL://localhost:3306/mydatabase? useSSL=false&serverTimezone=UTC"/>

The following example uses WebSphere, Tomcat, and XML configuration files as illustrations to demonstrate how to modify configuration files when integrating plugins.

  1. Open the WebSphere Console, then click Resources> JDBC> JDBC Providers on the left-hand side of the menu.
  2. Click New on the right side of the menu to create a JDBC driver, as shown in Figure 1.

    Figure 1 Websphere – create driver information

  3. Create a JDBC provider; select User-defined as the database type and specify the implementation class name as `com.pced.engine.spy.MaskingDriverPoolDataSource`, as shown in Figure 2.

    Figure 2 Websphere – select driver class

  4. The classpath for adding plugins. For this step, you must first place the plugin package in the `lib` directory; this directory is typically located at `${Product Installation Path}/AppServer/lib`, as shown in Figure 3.

    Figure 3 Websphere – modify driver path

  5. Click Complete to create the JDBC provider, as shown in Figure 4.

    Figure 4 Websphere – complete driver creation

  6. Click Resources> JDBC> Data Source, then click New on the right side of the menu to create a data source. Note that the node name and server name must match those used when creating the JDBC provider, as shown in Figure 5.

    Figure 5 Websphere – select data source

  7. Create a new data source; both the data source name and JNDI name should be set to "masking". Click Next, as shown in Figure 6.

    Figure 6 Websphere – create data source

  8. On the JDBC Provider Selection page, click Select Existing JDBC Provider, select the previously created JDBC provider, and then click Next, as shown in Figure 7.

    Figure 7 Websphere – select driver

  9. Click Next, as shown in Figure 8.

    Figure 8 Websphere – input control class

  10. Enter the credentials for an existing account; if no account exists, leave this field blank. After creating the data source, you can edit and configure it further. Click Next, as shown in Figure 9.

    Figure 9 Websphere – input alias

  11. Click Finish, as shown in Figure 10.

    Figure 10 Websphere – browse configuration information

  12. On the Data Source> Masking> JAAS-J2C> Authentication Data page, configure the account credentials; then click New, as shown in Figure 11.

    Figure 11 Websphere – select data source

  13. Enter your username and password, then click OK, as shown in Figure 12.

    Figure 12 Websphere – add authentication information

  14. Configure the URL information for the data source; edit the data source, then click Customize Properties, as shown in Figure 13.

    Figure 13 Websphere – edit data source

  15. On the Custom Attributes page, click New, as shown in Figure 14.

    Figure 14 Websphere – managing other data sources

  16. Enter the database URL information on the new page, as shown in Figure 15. The method for entering the URL varies depending on the database type; please refer to the JDBC Data Source Configuration File.

    Figure 15 Websphere – configure other data sources

  17. After saving all information, check whether the page displays the following message; if it does, click Save – this represents the final saved result, as shown in Figure 16.

    Figure 16 Websphere – browser prompt message

  1. Log in to the WebLogic Server Management Console, select Services> Data Sources, then click on the Data Source Name on the right side of the page to navigate to the Data Source Details page, as shown in Figure 17.

    Figure 17 Weblogic – browse data sources

  2. On the Data Source Details page, select the Configuration> Connection Pool tab, then modify the URL and driver class name on this page to the following configuration, as shown in Figure 18.

    This configuration uses MySQL as an example; the URL configuration varies depending on the database type – please refer to the JDBC Data Source Configuration File for specific instructions.

    Figure 18 Weblogic – URL configuration

Tomcat supports two types of data source configuration: local data source configuration and global data source configuration. The two configuration methods are as follows:

  • The local data source file path configured in Tomcat is "${tomcat installation path}/conf/context.xml"; modify the configuration file as follows, as shown in Figure 19.

    This configuration uses Oracle as an example; the URL configuration varies depending on the database being used – please refer to the Data Source JDBC Configuration File for specific instructions.

    Figure 19 Tomcat configuration modification
  • The global data source file path configured in Tomcat is "${tomcat installation path}/conf/server.xml"; simply modify the configuration file as shown in Figure 20.
    Figure 20 Tomcat configuration modification

The plugin approach also supports typical industry applications, including FanSoft Report and Kettle ETL.

  1. Log in to the Data Decision-Making System, then select Management System > Data Connection > Data Connection Management.
  2. Click Edit on the right side of the page, as shown in Figure 21.

    Figure 21 FineReport– edit data connection

  3. On the Data Source Editing Interface, modify the driver information and database URL.

    For driving information, simply select the default option first, then edit the text directly – there's no need to click the dropdown menu.

  4. Click Test Connection to verify whether the configuration is correct, as shown in Figure 22.

    The URL format varies depending on the database; please refer to the Data Source JDBC Configuration File for specific instructions.

    Figure 22 FineReport– edit data connection

  1. In Kettle's main object tree, select Transform> DB Connection; right-click on the data source you wish to edit, then left-click on Edit, as shown in Figure 23.

    Figure 23 Kettle – select data source

  2. On the Pop-up Data Source Connection Editing Page, select Generic Database as the connection type and Native (JDBC) as the connection method, then edit the custom connection URL and custom driver class name, as shown in Figure 24.

    The URL format varies depending on the database; please refer to the JDBC Data Source Configuration File.

    Figure 24 Kettle – select data source

JDBC Data Source Configuration File

Modify the program's database connection configuration file; modify the JDBC configuration file:

driver-class-name: com.pced.engine.spy.MaskingDriver

The differences in Jdbc-URL configuration are as follows:

  • MySQL

    jdbc-url: jdbc:masking:MySQL://*****:3306/****

  • MS SQLServer

    jdbc-url: jdbc:masking:sqlserver://*****:1433;DatabaseName=database;applicationName=schem ;

  • DM (Dameng)

    jdbc-url: jdbc:masking:dm://*****:5237?SCHEMA=myschema

    Here, `myschema` refers to the database schema.

  • OpenGauss

    jdbc-url: jdbc:masking:postgresql://*****:5432/database?currentSchema=myschema

    Here, `myschema` refers to the database schema.

  • DB2

    jdbc-url: jdbc:masking:db2://*****:50000/test:currentSchema=RY

    Here, RY represents the database schema.

  • KingBase

    jdbc-url: jdbc:masking:kingbase8://*****:54321/test?currentSchema= myschema

    Here, `myschema` refers to the database schema.

  • Oracle

    jdbc-url: jdbc:masking:oracle:thin:@*****:1521/TEST

  • PostgreSQL

    jdbc-url:jdbc:masking:postgresql://*****:54321/wireless?currentSchema=myschema

    Here, `myschema` refers to the database schema.

  • MariaDB

    jdbc-url: jdbc:masking:mariadb://*****:3306/****

  • Greenplum

    jdbc-url: jdbc:masking:postgresql://*****:5432/database?currentSchema=myschema

    Here, `myschema` refers to the database schema.