Package com.alibaba.druid.pool

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


        PreparedStatementHolder stmtHoler_3;
        PreparedStatementHolder stmtHoler_4;
       
        // sql_0连续执行两次
        {
            DruidPooledPreparedStatement stmt_0 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_0);

            Assert.assertFalse(stmt_0.getPreparedStatementHolder().isPooling());

            stmt_0.close();
            Assert.assertEquals(1, stmtPool.size());
View Full Code Here


            stmt_0.close();
            Assert.assertEquals(1, stmtPool.size());
            Assert.assertTrue(stmt_0.getPreparedStatementHolder().isPooling());
        }
        {
            DruidPooledPreparedStatement stmt_0 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_0);
            Assert.assertEquals(1, stmtPool.size());
            Assert.assertTrue(stmt_0.getPreparedStatementHolder().isInUse());
            Assert.assertTrue(stmt_0.getPreparedStatementHolder().isPooling());

            stmt_0.close();
View Full Code Here

            Assert.assertFalse(stmt_0.getPreparedStatementHolder().isInUse());
            Assert.assertTrue(stmt_0.getPreparedStatementHolder().isPooling());
            Assert.assertEquals(1, stmtPool.size());
        }
       
        DruidPooledPreparedStatement stmt_0 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_0);
       
        stmtHoler_0 = stmt_0.getPreparedStatementHolder();
       
        Assert.assertTrue(stmtHoler_0.isInUse());
        Assert.assertTrue(stmtHoler_0.isPooling());
View Full Code Here

        Assert.assertTrue(stmtHoler_0.isPooling());
       
        stmt_0.execute();
       
        {
            DruidPooledPreparedStatement stmt_1 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_1);
            Assert.assertEquals(1, stmtPool.size());
           
            stmtHoler_1 = stmt_1.getPreparedStatementHolder();
           
            Assert.assertTrue(stmt_1.getPreparedStatementHolder().isInUse());
View Full Code Here

       
        Assert.assertTrue(stmtHoler_0.isPooling());
        Assert.assertTrue(stmtHoler_1.isPooling());
       
        {
            DruidPooledPreparedStatement stmt_2 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_2);
            Assert.assertEquals(2, stmtPool.size());
           
            stmtHoler_2 = stmt_2.getPreparedStatementHolder();
           
            Assert.assertTrue(stmt_2.getPreparedStatementHolder().isInUse());
View Full Code Here

        Assert.assertTrue(stmtHoler_0.isPooling());
        Assert.assertTrue(stmtHoler_1.isPooling());
        Assert.assertTrue(stmtHoler_2.isPooling());
       
        {
            DruidPooledPreparedStatement stmt_3 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_3);
            Assert.assertEquals(3, stmtPool.size());
           
            stmtHoler_3 = stmt_3.getPreparedStatementHolder();
           
            Assert.assertTrue(stmt_3.getPreparedStatementHolder().isInUse());
View Full Code Here

        Assert.assertTrue(stmtHoler_1.isPooling());
        Assert.assertTrue(stmtHoler_2.isPooling());
        Assert.assertTrue(stmtHoler_3.isPooling());
       
        {
            DruidPooledPreparedStatement stmt_4 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_4);
            Assert.assertEquals(3, stmtPool.size());
           
            stmtHoler_4 = stmt_4.getPreparedStatementHolder();
           
            Assert.assertTrue(stmt_4.getPreparedStatementHolder().isInUse());
View Full Code Here

        conn.getConnection().close();

        {
            SQLException error = null;
            try {
                conn.prepareStatement("SELECT 1");
            } catch (SQLException ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
View Full Code Here

        conn.getConnection().close();

        {
            SQLException error = null;
            try {
                conn.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            } catch (SQLException ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
View Full Code Here

        conn.getConnection().close();

        {
            SQLException error = null;
            try {
                conn.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
                                      ResultSet.HOLD_CURSORS_OVER_COMMIT);
            } catch (SQLException ex) {
                error = ex;
            }
            Assert.assertNotNull(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.