Package java.sql

Examples of java.sql.PreparedStatement.unwrap()


        DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", 0);
            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", 0);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
View Full Code Here


            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", 0);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
            stmt.close();
        }

        conn.close();
    }
View Full Code Here

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
View Full Code Here

            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
            stmt.close();
        }

        conn.close();
    }
View Full Code Here

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY);
            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY);
View Full Code Here

            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                      ResultSet.CONCUR_READ_ONLY);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
            stmt.close();
        }

        conn.getConnectionHolder().toString();
        conn.getConnectionHolder().setLastActiveTimeMillis(0);
View Full Code Here

    public void test_executeQuery() throws Exception {
        Connection conn = dataSource.getConnection();

        PreparedStatement stmt = conn.prepareStatement("select ?");

        MyPreparedStatement myStmt = stmt.unwrap(MyPreparedStatement.class);

        Assert.assertNull(myStmt.updateCount);

        stmt.setString(1, "xxx");
        ResultSet rs = stmt.executeQuery();
View Full Code Here

    public void test_execute() throws Exception {
        Connection conn = dataSource.getConnection();

        PreparedStatement stmt = conn.prepareStatement("update t set id = ?");

        MyPreparedStatement myStmt = stmt.unwrap(MyPreparedStatement.class);

        Assert.assertNull(myStmt.updateCount);

        stmt.setString(1, "xxx");
        stmt.execute();
View Full Code Here

        {
            Connection conn = dataSource.getConnection();

            PreparedStatement stmt = conn.prepareStatement("update t set id = ?");

            myStmtA = stmt.unwrap(MyPreparedStatement.class);

            Assert.assertNull(myStmtA.updateCount);

            stmt.setString(1, "xxx");
            stmt.execute();
View Full Code Here

        {
            Connection conn = dataSource.getConnection();

            PreparedStatement stmt = conn.prepareStatement("update t set id = ?");

            myStmtB = stmt.unwrap(MyPreparedStatement.class);
            Assert.assertSame(myStmtA, myStmtB);
            Assert.assertNotNull(myStmtB.updateCount);

            stmt.setString(1, "xxx");
            stmt.execute();
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.