mock refactor

This commit is contained in:
温少
2012-06-06 08:59:34 +08:00
parent ffeb629f0d
commit 9a02c925b4
3 changed files with 25 additions and 8 deletions
@@ -41,15 +41,17 @@ public class MockPreparedStatement extends PreparedStatementBase implements Prep
@Override
public ResultSet executeQuery() throws SQLException {
checkOpen();
MockConnection conn = getConnection();
if (getConnection() != null && getConnection().getDriver() != null) {
if (conn != null && conn.getDriver() != null) {
return getConnection().getDriver().createResultSet(this);
}
if (getConnection() != null) {
getConnection().handleSleep();
if (conn != null) {
conn.handleSleep();
}
return new MockResultSet(this);
}