Examples of DruidPooledCallableStatement


Examples of com.alibaba.druid.pool.DruidPooledCallableStatement

    protected void setUp() throws Exception {
        MockConnection mockConn = new MockConnection();
        DruidConnectionHolder connHolder = new DruidConnectionHolder(dataSource, mockConn);
        conn = new DruidPooledConnection(connHolder);
        raw = new MockCallableStatement(null, null);
        stmt = new DruidPooledCallableStatement(conn, new PreparedStatementHolder(new PreparedStatementKey("", null,
                                                                                                           null, 0, 0,
                                                                                                           0), raw)) {

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

Examples of com.alibaba.druid.pool.DruidPooledCallableStatement

        Assert.assertEquals(1, dataSource.getPoolingCount());
    }

    public void test_getObject() throws Exception {
        Connection conn = dataSource.getConnection();
        DruidPooledCallableStatement stmt = (DruidPooledCallableStatement) conn.prepareCall("select 1");
        stmt.execute();

        Assert.assertEquals(0, dataSource.getErrorCount());

        Exception error = null;
        try {
            stmt.getObject(1, String.class);
        } catch (SQLFeatureNotSupportedException e) {
            error = e;
        }
        Assert.assertNotNull(error);

        Assert.assertEquals(0, dataSource.getErrorCount());

        stmt.close();
        conn.close();

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

Examples of com.alibaba.druid.pool.DruidPooledCallableStatement

        Assert.assertEquals(1, dataSource.getPoolingCount());
    }

    public void test_getObject_1() throws Exception {
        Connection conn = dataSource.getConnection();
        DruidPooledCallableStatement stmt = (DruidPooledCallableStatement) conn.prepareCall("select 1");
        stmt.execute();

        Assert.assertEquals(0, dataSource.getErrorCount());

        Exception error = null;
        try {
            stmt.getObject("1", String.class);
        } catch (SQLFeatureNotSupportedException e) {
            error = e;
        }
        Assert.assertNotNull(error);

        Assert.assertEquals(0, dataSource.getErrorCount());

        stmt.close();
        conn.close();

        Assert.assertEquals(1, dataSource.getPoolingCount());
    }
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.