Package java.sql

Examples of java.sql.PreparedStatement.unwrap()


         stmt.executeQuery("some sql");
         Assert.assertFalse(stmt.isClosed());
         Assert.assertNotNull(stmt.getGeneratedKeys());
         Assert.assertNotNull(stmt.getResultSet());
         Assert.assertNotNull(stmt.getConnection());
         Assert.assertTrue(stmt.unwrap(StubStatement.class) instanceof StubStatement);
         try {
            stmt.unwrap(TestProxies.class);
            Assert.fail();
         }
         catch (SQLException e) {
View Full Code Here


         Assert.assertNotNull(stmt.getGeneratedKeys());
         Assert.assertNotNull(stmt.getResultSet());
         Assert.assertNotNull(stmt.getConnection());
         Assert.assertTrue(stmt.unwrap(StubStatement.class) instanceof StubStatement);
         try {
            stmt.unwrap(TestProxies.class);
            Assert.fail();
         }
         catch (SQLException e) {
            // pass
         }
View Full Code Here

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

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

        conn.close();
    }
View Full Code Here

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareStatement("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.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
                                                           ResultSet.CONCUR_READ_ONLY,
View Full Code Here

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

        conn.close();
    }
View Full Code Here

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

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", new int[0]);
            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", new int[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", new int[0]);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
            stmt.close();
        }

        conn.close();
    }
View Full Code Here

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

        MockPreparedStatement raw = null;
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", new String[0]);
            raw = stmt.unwrap(MockPreparedStatement.class);
            stmt.close();
        }
        {
            PreparedStatement stmt = conn.prepareStatement("SELECT 1", new String[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", new String[0]);
            Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
            stmt.close();
        }

        conn.close();
    }
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.