Examples of DruidPooledStatement


Examples of com.alibaba.druid.pool.DruidPooledStatement

    }
   
    public void test_closeOnCompletion_error() throws Exception {
        Connection conn = dataSource.getConnection();
       
        DruidPooledStatement stmt = (DruidPooledStatement) conn.createStatement();
       
        Assert.assertEquals(0, dataSource.getPoolingCount());
        Assert.assertEquals(1, dataSource.getActiveCount());
        Assert.assertEquals(0, dataSource.getErrorCount());
       
        Exception error = null;
        try {
            stmt.closeOnCompletion();
        } catch (SQLFeatureNotSupportedException e) {
            error = e;
        }
        Assert.assertNotNull(error);
       
        Assert.assertEquals(0, dataSource.getErrorCount());
       
        stmt.close();
        conn.close();
       
        Assert.assertEquals(1, dataSource.getPoolingCount());
        Assert.assertEquals(0, dataSource.getActiveCount());
    }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidPooledStatement

    }
   
    public void test_isCloseOnCompletion_error() throws Exception {
        Connection conn = dataSource.getConnection();
       
        DruidPooledStatement stmt = (DruidPooledStatement) conn.createStatement();
       
        Assert.assertEquals(0, dataSource.getPoolingCount());
        Assert.assertEquals(1, dataSource.getActiveCount());
        Assert.assertEquals(0, dataSource.getErrorCount());
       
        Exception error = null;
        try {
            stmt.isCloseOnCompletion();
        } catch (SQLFeatureNotSupportedException e) {
            error = e;
        }
        Assert.assertNotNull(error);
       
        Assert.assertEquals(0, dataSource.getErrorCount());
       
        stmt.close();
        conn.close();
       
        Assert.assertEquals(1, dataSource.getPoolingCount());
        Assert.assertEquals(0, dataSource.getActiveCount());
    }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidPooledStatement

    protected Statement         raw;
    protected DruidPooledStatement stmt;

    protected void setUp() throws Exception {
        raw = new MockStatement(null);
        stmt = new DruidPooledStatement(null, raw) {

            protected SQLException checkException(Throwable error) throws SQLException {
                if (error instanceof SQLException) {
                    return (SQLException) error;
                }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidPooledStatement

            public void close() throws SQLException {
                throw new SQLException();
            }
        };

        DruidPooledStatement stmt = new DruidPooledStatement(null, null) {

            public void close() throws SQLException {
                addResultSetTrace(rs);
                clearResultSet();
            }
        };
        stmt.close();

    }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidPooledStatement

    private DruidPooledStatement stmt;
    private MockResultSet     raw;
    private DruidPooledResultSet resultSet;

    protected void setUp() throws Exception {
        stmt = new DruidPooledStatement(null, null) {

            protected SQLException checkException(Throwable error) throws SQLException {
                if (error instanceof SQLException) {
                    return (SQLException) error;
                }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidPooledStatement

    private DruidPooledStatement stmt;
    private MockResultSet     raw;
    private DruidPooledResultSet resultSet;

    protected void setUp() throws Exception {
        stmt = new DruidPooledStatement(null, null) {

            protected SQLException checkException(Throwable error) throws SQLException {
                if (error instanceof SQLException) {
                    return (SQLException) error;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.