use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_executeUpdate_3.
public void test_executeUpdate_3() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.executeUpdate("SELECT 1", Statement.NO_GENERATED_KEYS);
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.execute("SELECT 1", Statement.NO_GENERATED_KEYS);
} 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_getResultSetHoldability.
public void test_getResultSetHoldability() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getResultSetHoldability();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getResultSetHoldability();
} 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_error.
public void test_executeUpdate_error() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.executeUpdate("SET @VAR = 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_executeQuery_error.
public void test_executeQuery_error() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.executeQuery("SELECT 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_getResultSet.
public void test_getResultSet() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.getResultSet();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.getResultSet();
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
stmt.close();
conn.close();
}
Aggregations