Package com.alibaba.druid.pool

Examples of com.alibaba.druid.pool.DruidPooledConnection.createStatement()


        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException execErrror = null;
View Full Code Here


    }

    public void test_recycle() throws Exception {
        DruidPooledConnection conn = dataSource.getConnection();

        Statement stmt = conn.createStatement();
        stmt.execute("select 1");

        Assert.assertEquals(0, dataSource.getPoolingCount());
        Assert.assertEquals(1, dataSource.getActiveCount());
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException execErrror = null;
View Full Code Here

    public void test_recycle_error() throws Exception {
        DruidPooledConnection conn = dataSource.getConnection();
        conn.setAutoCommit(false);
        conn.setReadOnly(false);

        Statement stmt = conn.createStatement();
        stmt.execute("select 1");

        Assert.assertEquals(0, dataSource.getPoolingCount());
        Assert.assertEquals(1, dataSource.getActiveCount());
View Full Code Here

                try {
                    DruidPooledConnection conn = dataSource.getConnection();
                    conn.setAutoCommit(false);
                    conn.setReadOnly(false);

                    Statement stmt = conn.createStatement();
                    stmt.execute("select 1");

                    Assert.assertEquals(0, dataSource.getPoolingCount());
                    Assert.assertEquals(1, dataSource.getActiveCount());
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();
        stmt.execute(sql);

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();
        stmt.execute(sql);

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException stmtErrror = null;
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException stmtErrror = null;
View Full Code Here

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException stmtErrror = null;
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.