--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java Tue Feb 26 17:31:41 2019 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java Tue Feb 26 18:19:49 2019 +0100
@@ -58,6 +58,13 @@
* @throws java.sql.SQLException
*/
public static Connection jdbcConnect(DatabaseDefinition databaseDefinition, Properties properties) throws SQLException {
+ synchronized (properties) {
+ /**
+ * Avoid rewriting the properties. Usually, the connection is created only once, but
+ * with --test-connection and with SQL-DK JDBC driver, it might be reused.
+ */
+ properties = properties.clone();
+ }
if (properties.hasProperty(JDBC_PROPERTY_PASSWORD)) {
log.log(Level.WARNING, "Passing DB password as CLI parameter is insecure!");
}