From 9339a1865d53377acb1bb63c667dfc9b913d7a8f Mon Sep 17 00:00:00 2001 From: Dordian Draconia Date: Thu, 22 Sep 2011 15:48:42 +0300 Subject: [PATCH 1/2] Java7 compatibility --- src/de/diddiz/util/MySQLConnectionPool.java | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/de/diddiz/util/MySQLConnectionPool.java b/src/de/diddiz/util/MySQLConnectionPool.java index a0f920e..0464de9 100644 --- a/src/de/diddiz/util/MySQLConnectionPool.java +++ b/src/de/diddiz/util/MySQLConnectionPool.java @@ -108,11 +108,15 @@ public class MySQLConnectionPool implements Closeable private final Connection conn; private boolean inuse; private long timestamp; + private int networkTimeout; + private String schema; JDCConnection(Connection conn) { this.conn = conn; inuse = false; timestamp = 0; + networkTimeout = 30; + schema = "default"; } @Override @@ -366,6 +370,26 @@ public class MySQLConnectionPool implements Closeable public T unwrap(Class iface) throws SQLException { return conn.unwrap(iface); } + + public int getNetworkTimeout() throws SQLException { + return networkTimeout; + } + + public void setNetworkTimeout(Executor exec, int timeout) throws SQLException { + networkTimeout = timeout; + } + + public void abort(Executor exec) throws SQLException { + //Not implemented really... + } + + public String getSchema() throws SQLException { + return schema; + } + + public void setSchema(String str) throws SQLException { + schema = str; + } long getLastUse() { return timestamp; From 1c5d9c75cd93155d59bee354475d7bba411cbbeb Mon Sep 17 00:00:00 2001 From: Dordian Draconia Date: Thu, 22 Sep 2011 15:49:20 +0300 Subject: [PATCH 2/2] Forgot importing Executor class... --- src/de/diddiz/util/MySQLConnectionPool.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/diddiz/util/MySQLConnectionPool.java b/src/de/diddiz/util/MySQLConnectionPool.java index 0464de9..f80ec48 100644 --- a/src/de/diddiz/util/MySQLConnectionPool.java +++ b/src/de/diddiz/util/MySQLConnectionPool.java @@ -21,6 +21,7 @@ import java.util.Enumeration; import java.util.Map; import java.util.Properties; import java.util.Vector; +import java.util.concurrent.Executor; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock;