Database URLs parameters
This document provides a comprehensive explanation of JDBC connection parameters for SQL Server and MySQL databases. In addition to defining each parameter, it also outlines alternative values, and their meanings. This expanded overview helps you make informed decisions when configuring secure and reliable database connections.
SQL server JDBC URL
Format:
Code
jdbc:sqlserver://<hostname>:<port>;database=<database name>;encrypt=true;trustServerCertificate=false;authentication=ActiveDirectoryPassword;
Parameter breakdown and possible values
| Parameter | Description | Possible values | Recommended | Notes |
|---|---|---|---|---|
| <hostname> | Specifies the DNS name or IP address of the SQL server host. • Example: sqlserver.company.com • Example: 192.168.1.10 | Any valid DNS or IP | N/A | Identifies SQL server instance. |
| <port> | Defines the port number where SQL Server listens. • Default: 1433 • Can be customized depending on your SQL Server configuration. | Default: 1433; custom ports allowed | N/A | Change only if SQL Server uses non-standard port. |
| <database name> | Name of target schema/database, for example, adeptia_backend. | Any valid DB name | N/A | Must exist on the server. |
| encrypt | Enables TLS encryption | true, false | true | Setting it to true ensures that data transmitted between the application and SQL Server is encrypted using TLS. Azure SQL requires this. |
| trustServerCertificate | Verifies the server certificate | true, false | false | • false: the driver validates the server’s SSL certificate against a trusted Certificate Authority (CA). Prevents man-in-the-middle attacks. • true: Skips certificate validation (not secure). |
| authentication | Authentication method | • ActiveDirectoryPassword • ActiveDirectoryIntegrated • SQLPassword • ActiveDirectoryMsi | Depends on environment | • ActiveDirectoryPassword: Uses Azure AD credentials instead of SQL username/password.• ActiveDirectoryIntegrated: Uses the machine’s domain credentials for single sign‑on.• SQLPassword: Traditional SQL username/password authentication.• ActiveDirectoryMsi: Uses Managed Identity when running in Azure. |
MySQL server JDBC URL
Format:
** Code
jdbc:mysql://<hostname>:<port>/<database name>?sslMode=VERIFY_IDENTITY&fallbackToSystemKeyStore=false
**
Parameter breakdown and possible values
| Parameter | Description | Possible Values | Recommended | Notes |
|---|---|---|---|---|
| <hostname> | Specifies the DNS name or IP address of the MySQL server host. • Example: mysqlserver.company.com • Example: 192.168.2.20 | Any valid DNS or IP | N/A | Identifies the MySQL server instance. |
| <port> | Defines the port number where MySQL Server listens. | Default: 3306 | N/A | |
| <database name> | Name of target schema/database, for example, adeptia_backend. | Any valid database name | N/A | Must exist on the server. |
| sslMode | SSL mode that determines how SSL/TLS encryption and server certificate validation will be handled during database connections. | • DISABLED • PREFERRED • REQUIRED • VERIFY_CA VERIFY_IDENTITY | VERIFY_IDENTITY | • DISABLED: SSL/TLS is completely disabled (equivalent to useSSL=false). The connection uses plaintext transport.• PREFERRED: SSL/TLS is used if available; otherwise, the connection falls back to non-SSL. (Default mode if not specified) • REQUIRED: SSL/TLS must be used, but the hostname and CA are not verified. Prevents fallback to non-SSL. • VERIFY_CA: SSL/TLS with server certificate validation against a trusted CA. Hostname is not verified. • VERIFY_IDENTITY: SSL/TLS with both CA verification and hostname verification. Provides the highest level of security and is recommended for production. |
| fallbackToSystemKeyStore | Controls whether the connector should use system‑level trust stores if custom SSL configuration is missing. | true, false | false | **false:**Tells the driver not to use the system key store (like OS-level CA certificates). Instead, it directly uses the JVM’s built-in truststore (cacerts) to validate the certificate. true: The system first attempts to locate or load a truststore automatically. If it cannot find one, it tries to fall back to the system’s default truststore (cacerts) on its own. |