use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_getWarnings.
public void test_getWarnings() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getWarnings();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getWarnings();
} 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_executeUpdate_2.
public void test_executeUpdate_2() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.executeUpdate("SELECT 1", new int[0]);
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.execute("SELECT 1", new int[0]);
} 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_execute.
public void test_execute() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("SELECT 1", new String[0]);
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.execute("SELECT 1", new String[0]);
} 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_getGeneratedKeys.
public void test_getGeneratedKeys() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getGeneratedKeys();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getGeneratedKeys();
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
Aggregations