forked from LogBlock/LogBlock
Merge branch 'master' of https://DiddiZ@github.com/DiddiZ/LogBlock.git
This commit is contained in:
@@ -21,6 +21,7 @@ import java.util.Enumeration;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
@@ -108,11 +109,15 @@ public class MySQLConnectionPool implements Closeable
|
|||||||
private final Connection conn;
|
private final Connection conn;
|
||||||
private boolean inuse;
|
private boolean inuse;
|
||||||
private long timestamp;
|
private long timestamp;
|
||||||
|
private int networkTimeout;
|
||||||
|
private String schema;
|
||||||
|
|
||||||
JDCConnection(Connection conn) {
|
JDCConnection(Connection conn) {
|
||||||
this.conn = conn;
|
this.conn = conn;
|
||||||
inuse = false;
|
inuse = false;
|
||||||
timestamp = 0;
|
timestamp = 0;
|
||||||
|
networkTimeout = 30;
|
||||||
|
schema = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -366,6 +371,26 @@ public class MySQLConnectionPool implements Closeable
|
|||||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||||
return conn.unwrap(iface);
|
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() {
|
long getLastUse() {
|
||||||
return timestamp;
|
return timestamp;
|
||||||
|
Reference in New Issue
Block a user