diff --git a/Server/src/main/java/org/openas2/processor/msgtracking/EmbeddedDBHandler.java b/Server/src/main/java/org/openas2/processor/msgtracking/EmbeddedDBHandler.java index 0c0c70ea..5fd8c873 100644 --- a/Server/src/main/java/org/openas2/processor/msgtracking/EmbeddedDBHandler.java +++ b/Server/src/main/java/org/openas2/processor/msgtracking/EmbeddedDBHandler.java @@ -1,5 +1,7 @@ package org.openas2.processor.msgtracking; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.h2.jdbcx.JdbcConnectionPool; import org.h2.tools.Server; import org.openas2.OpenAS2Exception; @@ -8,6 +10,9 @@ import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; +import java.sql.Driver; +import java.sql.DriverManager; +import java.util.Enumeration; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -46,7 +51,10 @@ public void start(String connectString, String userName, String pwd, Map drivers = DriverManager.getDrivers(); + Driver driver = drivers.nextElement();// home into first and the only + Log logger = LogFactory.getLog(getName()); + logger.info("Using JDBC driver: " + driver.getClass().getName()); try { server = Server.createTcpServer("-tcpPort", tcpPort, "-tcpPassword", tcpPwd, "-baseDir", dbDirectory, "-tcpAllowOthers").start(); } catch (SQLException e) { @@ -83,6 +91,8 @@ public Connection getConnection() throws SQLException, OpenAS2Exception { if (cp == null) { throw new OpenAS2Exception("Connection pool not initialized."); } + + return cp.getConnection(); }