Skip to main content

How to Configure the Java Application

Goal

Configure the application by adding

  • the database driver to the maven dependencies, in the pom.xml
  • the database URL to the src/main/resources/config.properties

Database Driver (pom.xml)

Navigate to pom.xml. Add the correct Maven JDBC Driver dependency.

pom.xml (Sql Server dependency)

    ...
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.4.0.jre8</version> <!-- Note jre8, not jre11 or jre16 -->
</dependency>
...

Tips:

Find the correct Maven Dependency by

Note: The dependency must be Java 8 compatible.

Database URL and Credentials

Navigate to src/main/resources/config.properties. Provide the URL and credentials for the database connection here.

config.properties

# Database connection parameters
connection.host = localhost
connection.port = 1433
connection.db = master
connection.schema = pii_tables
connection.user = username
connection.password = password
connection.driverClass = com.microsoft.sqlserver.jdbc.SQLServerDriver
connection.url = jdbc:sqlserver://localhost:1433;database=master
file.encryptionkey =
sql.wrapper = "
  • Make sure to change sql.wrapper to backticks (`) when using a MySql database. Other databases may use double quotes "
  • If mapping files are encrypted, provide your own file.encryptionkey