diff --git a/pom.xml b/pom.xml index 1fd8dc2..848f334 100755 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ com.erudika para-core - 1.29.2 + 1.30.0 provided @@ -84,7 +84,6 @@ com.h2database h2 - 1.4.197 @@ -252,7 +251,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + 3.0.1 attach-javadocs diff --git a/src/main/java/com/erudika/para/persistence/H2Utils.java b/src/main/java/com/erudika/para/persistence/H2Utils.java index 9720644..f7fcf4e 100644 --- a/src/main/java/com/erudika/para/persistence/H2Utils.java +++ b/src/main/java/com/erudika/para/persistence/H2Utils.java @@ -61,15 +61,15 @@ private H2Utils() { } */ static Connection getConnection() throws SQLException { String host = Config.getConfigParam("db.hostname", ""); - String serverPrefix = StringUtils.isBlank(host) ? "" : "tcp://" + host + "/"; - String dir = Config.getConfigParam("db.dir", serverPrefix.isEmpty() ? "./data" : "data"); - String url = "jdbc:h2:" + serverPrefix + dir + File.separator + Config.getRootAppIdentifier(); + String tcpPrefix = StringUtils.isBlank(host) ? "" : "tcp://" + host + "/"; + String dir = Config.getConfigParam("db.dir", "./data"); + String url = "jdbc:h2:" + tcpPrefix + dir + File.separator + Config.getRootAppIdentifier(); String user = Config.getConfigParam("db.user", Config.getRootAppIdentifier()); String pass = Config.getConfigParam("db.password", "secret"); try { if (server == null) { org.h2.Driver.load(); - String serverParams = Config.getConfigParam("db.tcpServer", "-baseDir " + dir); + String serverParams = Config.getConfigParam("db.tcpServer", tcpPrefix.isEmpty() ? "-baseDir " + dir : ""); String[] params = StringUtils.split(serverParams, ' '); server = Server.createTcpServer(params); server.start();