support initSqls

This commit is contained in:
wenshao
2013-07-04 23:38:16 +08:00
parent dcda68116d
commit 4b8e847cb1
6 changed files with 130 additions and 15 deletions
@@ -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();