mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for duplicate getUpdateCount
This commit is contained in:
@@ -117,7 +117,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
return new MockPreparedStatement(this, sql);
|
||||
return createMockPreparedStatement(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -204,7 +204,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
MockPreparedStatement stmt = new MockPreparedStatement(this, sql);
|
||||
MockPreparedStatement stmt = createMockPreparedStatement(sql);
|
||||
|
||||
stmt.setResultSetType(resultSetType);
|
||||
stmt.setResultSetConcurrency(resultSetConcurrency);
|
||||
@@ -289,7 +289,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
MockPreparedStatement stmt = new MockPreparedStatement(this, sql);
|
||||
MockPreparedStatement stmt = createMockPreparedStatement(sql);
|
||||
|
||||
stmt.setResultSetType(resultSetType);
|
||||
stmt.setResultSetConcurrency(resultSetConcurrency);
|
||||
@@ -298,6 +298,16 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
return stmt;
|
||||
}
|
||||
|
||||
private MockPreparedStatement createMockPreparedStatement(String sql) {
|
||||
if (driver != null) {
|
||||
MockPreparedStatementFactory preparedStatementFactory = driver.getPreparedStatementFactory();
|
||||
if (preparedStatementFactory != null) {
|
||||
return preparedStatementFactory.createMockPreparedStatement(this, sql);
|
||||
}
|
||||
}
|
||||
return new MockPreparedStatement(this, sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
|
||||
int resultSetHoldability) throws SQLException {
|
||||
@@ -320,7 +330,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
return new MockPreparedStatement(this, sql);
|
||||
return createMockPreparedStatement(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -329,7 +339,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
return new MockPreparedStatement(this, sql);
|
||||
return createMockPreparedStatement(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -338,7 +348,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
throw new MockConnectionClosedException();
|
||||
}
|
||||
|
||||
return new MockPreparedStatement(this, sql);
|
||||
return createMockPreparedStatement(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user