Package com.alibaba.druid.mock

Examples of com.alibaba.druid.mock.MockStatement


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

        Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);

        MockStatement mockStmt = stmt.unwrap(MockStatement.class);

        Assert.assertEquals(ResultSet.TYPE_SCROLL_SENSITIVE, mockStmt.getResultSetType());
        Assert.assertEquals(ResultSet.CONCUR_UPDATABLE, mockStmt.getResultSetConcurrency());

        stmt.close();

        conn.close();
    }
View Full Code Here


        Connection conn = dataSource.getConnection();

        Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE,
                                              ResultSet.CLOSE_CURSORS_AT_COMMIT);

        MockStatement mockStmt = stmt.unwrap(MockStatement.class);

        Assert.assertEquals(ResultSet.TYPE_SCROLL_SENSITIVE, mockStmt.getResultSetType());
        Assert.assertEquals(ResultSet.CONCUR_UPDATABLE, mockStmt.getResultSetConcurrency());
        Assert.assertEquals(ResultSet.CLOSE_CURSORS_AT_COMMIT, mockStmt.getResultSetHoldability());

        stmt.close();

        conn.close();
    }
View Full Code Here

    protected Statement         raw;
    protected DruidPooledStatement stmt;

    protected void setUp() throws Exception {
        raw = new MockStatement(null);
        stmt = new DruidPooledStatement(null, raw) {

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

            public ResultSet executeQuery(MockStatementBase stmt, String sql) throws SQLException {
                return null;
            }
           
            public MockStatement createMockStatement(MockConnection conn) {
                return new MockStatement(conn) {
                    public ResultSet getResultSet() throws SQLException {
                        return null;
                    }
                };
            }
View Full Code Here

            @Override
            public void close() throws SQLException {
                throw new SQLException();
            }
        });
        JdbcUtils.close(new MockStatement(null) {

            @Override
            public void close() throws SQLException {
                throw new SQLException();
            }
View Full Code Here

                public ResultSetMetaData getMetaData() throws SQLException {
                    throw new SQLException();
                }
            };

            StatementProxy stmt = new StatementProxyImpl(conn, new MockStatement(conn) {

                public ResultSet getResultSet() throws SQLException {
                    return rs;
                }
            }, 0);
View Full Code Here

TOP

Related Classes of com.alibaba.druid.mock.MockStatement

Copyright © 2018 www.massapicom. 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.