Package com.alibaba.druid.proxy.jdbc

Examples of com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl


    }

    public void test_resultSet_getObject_1() throws Exception {
        FilterChainImpl chain = new FilterChainImpl(dataSource);

        Clob clob = (Clob) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), "1");

        Assert.assertTrue(clob instanceof ClobProxy);
        Assert.assertEquals(1, invokeCount);
    }
View Full Code Here


    }
   
    public void test_resultSet_getObject_2() throws Exception {
        FilterChainImpl chain = new FilterChainImpl(dataSource);
       
        Clob clob = (Clob) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), 1, Collections.<String, Class<?>>emptyMap());
       
        Assert.assertTrue(clob instanceof ClobProxy);
        Assert.assertEquals(1, invokeCount);
    }
View Full Code Here

    }
   
    public void test_resultSet_getObject_3() throws Exception {
        FilterChainImpl chain = new FilterChainImpl(dataSource);
       
        Clob clob = (Clob) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), "1", Collections.<String, Class<?>>emptyMap());
       
        Assert.assertTrue(clob instanceof ClobProxy);
        Assert.assertEquals(1, invokeCount);
    }
View Full Code Here

    public ResultSetProxy wrap(StatementProxy statement, ResultSet resultSet) {
        if (resultSet == null) {
            return null;
        }

        return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(),
                                      statement.getLastExecuteSql());
    }
View Full Code Here

    public ResultSetProxy wrap(StatementProxy statement, ResultSet resultSet) {
        if (resultSet == null) {
            return null;
        }

        return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(),
                                      statement.getLastExecuteSql());
    }
View Full Code Here

    public ResultSetProxy wrap(StatementProxy statement, ResultSet resultSet) {
        if (resultSet == null) {
            return null;
        }

        return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(),
                                      statement.getLastExecuteSql());
    }
View Full Code Here

        }

        if (object instanceof ResultSet) {
            long resultSetId = stmt.getConnectionProxy().getDirectDataSource().createResultSetId();
            ResultSet resultSet = (ResultSet) object;
            return new ResultSetProxyImpl(stmt, resultSet, resultSetId, stmt.getLastExecuteSql());
        }

        return object;
    }
View Full Code Here

                    return null;
                }
            };

            FilterChainImpl chain = new FilterChainImpl(dataSource);
            chain.resultSet_next(new ResultSetProxyImpl(stmt, rs, 1001, null));
        }
        {
            final MockResultSet rs = new MockResultSet(null) {

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

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

                public ResultSet getResultSet() throws SQLException {
                    return rs;
                }
            }, 0);

            FilterChainImpl chain = new FilterChainImpl(dataSource);
            chain.statement_getResultSet(stmt);
        }
        {
            StatementProxy stmt = (StatementProxy) conn.createStatement();
            MockResultSet rs = new MockResultSet(null) {

                @Override
                public ResultSetMetaData getMetaData() throws SQLException {
                    return rsMeta;
                }

                @Override
                public boolean next() throws SQLException {
                    return true;
                }

                @Override
                public Object getObject(int columnIndex) throws SQLException {
                    if (columnIndex == 5) {
                        throw new SQLException();
                    }
                    return null;
                }
            };

            {
                logFilter.setResultSetLogEnabled(false);
                FilterChainImpl chain = new FilterChainImpl(dataSource);
                chain.resultSet_next(new ResultSetProxyImpl(stmt, rs, 1001, null));
            }
            {
                logFilter.setResultSetNextAfterLogEnabled(false);
                FilterChainImpl chain = new FilterChainImpl(dataSource);
                chain.resultSet_next(new ResultSetProxyImpl(stmt, rs, 1001, null));
            }
        }
    }
View Full Code Here

            filter.statement_getGeneratedKeys(chain, statement);
        }

        {
            final ResultSetProxy resultSet = new ResultSetProxyImpl(statement, null, 2001, null);
            FilterChain chain = new FilterChainImpl(new DataSourceProxyImpl(null, config)) {

                public ResultSetProxy statement_getGeneratedKeys(StatementProxy statement) throws SQLException {
                    return resultSet;
                }
View Full Code Here

    public ResultSetProxy wrap(StatementProxy statement, ResultSet resultSet) {
        if (resultSet == null) {
            return null;
        }

        return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(),
                                      statement.getLastExecuteSql());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl

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.