Package com.alibaba.druid.proxy.jdbc

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


                                                                                                                      throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, resultSetType,
                                                                            resultSetConcurrency);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
View Full Code Here


                                                              int resultSetHoldability) throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, resultSetType,
                                                                            resultSetConcurrency, resultSetHoldability);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
View Full Code Here

                                                              String sql, int[] columnIndexes) throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, columnIndexes);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
        }
View Full Code Here

                                                              String sql, String[] columnNames) throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, columnNames);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
        }
View Full Code Here

        FilterEventAdapter filter = new FilterEventAdapter() {
        };

        String sql = "SELECT * FROM PATROL";
        ConnectionProxy connection = new ConnectionProxyImpl(dataSource, null, new Properties(), 1001);
        final PreparedStatementProxy statement = new PreparedStatementProxyImpl(connection, null, sql, 1002);

        {
            FilterChain chain = new FilterChainImpl(new DataSourceProxyImpl(null, config)) {

                public boolean statement_execute(StatementProxy statement, String sql) throws SQLException {
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());
        Assert.assertEquals(Types.BIGINT, stmtProxy.getParameter(3).getSqlType());
        Assert.assertEquals(Types.FLOAT, stmtProxy.getParameter(4).getSqlType());

        Assert.assertEquals(Types.DOUBLE, stmtProxy.getParameter(5).getSqlType());
        Assert.assertEquals(Types.DECIMAL, stmtProxy.getParameter(6).getSqlType());
        Assert.assertEquals(Types.BOOLEAN, stmtProxy.getParameter(7).getSqlType());
        Assert.assertEquals(Types.VARCHAR, stmtProxy.getParameter(8).getSqlType());
        Assert.assertEquals(Types.DATE, stmtProxy.getParameter(9).getSqlType());

        Assert.assertEquals(Types.DATE, stmtProxy.getParameter(10).getSqlType());
        Assert.assertEquals(Types.TIMESTAMP, stmtProxy.getParameter(11).getSqlType());
        Assert.assertEquals(Types.TIME, stmtProxy.getParameter(12).getSqlType());

        stmt.close();

        conn.close();
    }
View Full Code Here

                                                                                                                        throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
        }
View Full Code Here

                                                              String sql, int autoGeneratedKeys) throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, autoGeneratedKeys);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
        }
View Full Code Here

                                                                                                                      throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, resultSetType,
                                                                            resultSetConcurrency);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
View Full Code Here

                                                              int resultSetHoldability) throws SQLException {
        String dbType = connection.getDirectDataSource().getDbType();
        WallContext.create(dbType);
        try {
            sql = check(sql);
            PreparedStatementProxy stmt = chain.connection_prepareStatement(connection, sql, resultSetType,
                                                                            resultSetConcurrency, resultSetHoldability);
            setSqlStatAttribute(stmt);
            return stmt;
        } finally {
            WallContext.clearContext();
View Full Code Here

TOP

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

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.