use of com.alibaba.druid.pool.DruidPooledStatement in project druid by alibaba.
the class PoolableStatementTest2 method test_executeBatch.
public void test_executeBatch() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.executeBatch();
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.executeBatch();
} 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_1.
public void test_executeUpdate_1() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.executeUpdate("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_setCursorName.
public void test_setCursorName() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.setCursorName("c_name");
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.setCursorName("c_name");
} 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_5.
public void test_executeUpdate_5() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.executeUpdate("SET 1", Statement.RETURN_GENERATED_KEYS);
((DruidPooledStatement) stmt).getStatement().close();
{
SQLException error = null;
try {
stmt.executeUpdate("SET 1", Statement.RETURN_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_execute_1.
public void test_execute_1() throws Exception {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("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();
}
Aggregations