mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support initSqls
This commit is contained in:
@@ -55,6 +55,8 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
|
||||
private SQLException error;
|
||||
|
||||
private String lastSql;
|
||||
|
||||
public MockConnection(){
|
||||
this(null, null, null);
|
||||
}
|
||||
@@ -69,6 +71,14 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
}
|
||||
}
|
||||
|
||||
public String getLastSql() {
|
||||
return lastSql;
|
||||
}
|
||||
|
||||
public void setLastSql(String lastSql) {
|
||||
this.lastSql = lastSql;
|
||||
}
|
||||
|
||||
public SQLException getError() {
|
||||
return error;
|
||||
}
|
||||
@@ -268,7 +278,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
if (error != null) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
||||
if (closed) {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
@@ -469,7 +479,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
public int getNetworkTimeout() throws SQLException {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setReadOnly(boolean readOnly) throws SQLException {
|
||||
checkState();
|
||||
|
||||
Reference in New Issue
Block a user