use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class ResultSetTest method setUp.
protected void setUp() throws Exception {
stmt = new DruidPooledStatement(null, null) {
protected SQLException checkException(Throwable error) throws SQLException {
if (error instanceof SQLException) {
return (SQLException) error;
}
return new SQLException(error);
}
};
raw = new MockResultSet(null);
raw.getRows().add(new Object[] { null });
resultSet = new DruidPooledResultSet(stmt, raw);
}
use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_getMoreResults_1.
public void test_getMoreResults_1() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getMoreResults(1);
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getMoreResults(1);
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_getUpdateCount.
public void test_getUpdateCount() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getUpdateCount();
stmt.executeQuery("select 1");
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getUpdateCount();
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_getMoreResults.
public void test_getMoreResults() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getMoreResults();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getMoreResults();
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_clearWarnings.
public void test_clearWarnings() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.clearWarnings();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.clearWarnings();
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
Aggregations