Package java.sql

Examples of java.sql.PreparedStatement.unwrap()


            }

            PreparedStatement stmt = conn.prepareStatement(sql);
           
            {
                PreparedStatementHolder stmtHolder2 = stmt.unwrap(PreparedStatementHolder.class);
                Assert.assertSame(stmtHolder2, stmtHolder);
                Assert.assertEquals(1, stmtHolder.getHitCount());
            }

            ResultSet rs = stmt.executeQuery();
View Full Code Here


            ResultSet rs = stmt.executeQuery();
            rs.next();
            rs.close();
            stmt.close();
            {
                OraclePreparedStatement oracleStmt2 = stmt.unwrap(OraclePreparedStatement.class);
                Assert.assertSame(oracleStmt, oracleStmt2);
                Assert.assertEquals(2, oracleStmt.getRowPrefetch());
            }

            conn.close();
View Full Code Here

            // /////////////

            PreparedStatement stmt = conn.prepareStatement(sql);

            Assert.assertNotNull(stmt.unwrap(oracle.jdbc.OraclePreparedStatement.class));
            Assert.assertTrue(stmt.isWrapperFor(oracle.jdbc.OraclePreparedStatement.class));

            Assert.assertTrue(stmt.isWrapperFor(DruidPooledPreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(DruidPooledPreparedStatement.class));
           
View Full Code Here

            Assert.assertNotNull(stmt.unwrap(oracle.jdbc.OraclePreparedStatement.class));
            Assert.assertTrue(stmt.isWrapperFor(oracle.jdbc.OraclePreparedStatement.class));

            Assert.assertTrue(stmt.isWrapperFor(DruidPooledPreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(DruidPooledPreparedStatement.class));
           
            Assert.assertTrue(stmt.isWrapperFor(java.sql.PreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(java.sql.PreparedStatement.class));

            ResultSet rs = stmt.executeQuery();
View Full Code Here

            // /////////////

            PreparedStatement stmt = conn.prepareStatement(sql);

            Assert.assertNotNull(stmt.unwrap(oracle.jdbc.OraclePreparedStatement.class));
            Assert.assertTrue(stmt.isWrapperFor(oracle.jdbc.OraclePreparedStatement.class));

            Assert.assertTrue(stmt.isWrapperFor(DruidPooledPreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(DruidPooledPreparedStatement.class));
           
View Full Code Here

            Assert.assertNotNull(stmt.unwrap(oracle.jdbc.OraclePreparedStatement.class));
            Assert.assertTrue(stmt.isWrapperFor(oracle.jdbc.OraclePreparedStatement.class));

            Assert.assertTrue(stmt.isWrapperFor(DruidPooledPreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(DruidPooledPreparedStatement.class));
           
            Assert.assertTrue(stmt.isWrapperFor(java.sql.PreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(java.sql.PreparedStatement.class));

            ResultSet rs = stmt.executeQuery();
View Full Code Here

            Assert.assertTrue(stmt.isWrapperFor(DruidPooledPreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(DruidPooledPreparedStatement.class));
           
            Assert.assertTrue(stmt.isWrapperFor(java.sql.PreparedStatement.class));
            Assert.assertNotNull(stmt.unwrap(java.sql.PreparedStatement.class));

            ResultSet rs = stmt.executeQuery();

            Assert.assertNotNull(rs.unwrap(oracle.jdbc.OracleResultSet.class));
            Assert.assertTrue(rs.isWrapperFor(oracle.jdbc.OracleResultSet.class));
View Full Code Here

    public void test_0() throws Exception {
        MockPreparedStatement mockStmt = null;
        {
            Connection conn = dataSource.getConnection();
            PreparedStatement ps = conn.prepareStatement("select 1");
            mockStmt = ps.unwrap(MockPreparedStatement.class);
            ps.execute();
            conn.close();
        }
        for (int i = 0; i < 1000; ++i) {
            Connection conn = dataSource.getConnection();
View Full Code Here

        }
        for (int i = 0; i < 1000; ++i) {
            Connection conn = dataSource.getConnection();
            PreparedStatement ps = conn.prepareStatement("select 1");
           
            Assert.assertSame(mockStmt, ps.unwrap(MockPreparedStatement.class));
           
            ps.execute();
            ps.close();
            conn.close();
        }
View Full Code Here

        stmt.setObject(12, new java.sql.Timestamp(System.currentTimeMillis()));
        stmt.setObject(13, new java.sql.Time(System.currentTimeMillis()));

        stmt.execute();

        PreparedStatementProxy stmtProxy = stmt.unwrap(PreparedStatementProxy.class);
        Assert.assertNotNull(stmtProxy);

        Assert.assertEquals(Types.TINYINT, stmtProxy.getParameter(0).getSqlType());
        Assert.assertEquals(Types.SMALLINT, stmtProxy.getParameter(1).getSqlType());
        Assert.assertEquals(Types.INTEGER, stmtProxy.getParameter(2).getSqlType());
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.