Package com.alibaba.druid.proxy.jdbc

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


        return buf.toString();
    }

    protected void preparedStatement_setParameterBefore(PreparedStatementProxy statement, int parameterIndex, int sqlType, Object... values) {
        JdbcParameter parameter = new JdbcParameter(sqlType, values);

        getParameters(statement).put(parameterIndex, parameter);
    }
View Full Code Here


            return;
        }

        List<Object> parameters = new ArrayList<Object>(parametersSize);
        for (int i = 0; i < parametersSize; ++i) {
            JdbcParameter jdbcParam = statement.getParameter(i);
            parameters.add(jdbcParam.getValue());
        }

        String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
        String formattedSql = SQLUtils.format(sql, dbType, parameters);
        statementLog("{conn-" + statement.getConnectionProxy().getId() + ", " + stmtId(statement) + "} executed. "
View Full Code Here

                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Parameters : [");
               
                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }
                   
                    int sqlType = parameter.getSqlType();
                    Object value = parameter.getValue();
                    switch (sqlType) {
                        case Types.NULL:
                            buf.append("NULL");
                            break;
                        default:
                            buf.append(String.valueOf(value));
                            break;
                    }
                }
                buf.append("]");
                statementLog(buf.toString());
            }
            {
                StringBuffer buf = new StringBuffer();
                buf.append("{conn-");
                buf.append(statement.getConnectionProxy().getId());
                buf.append(", ");
                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Types : [");
                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }
                    int sqlType = parameter.getSqlType();
                    buf.append(JdbcUtils.getTypeName(sqlType));
                }
                buf.append("]");
                statementLog(buf.toString());
            }
View Full Code Here

        return buf.toString();
    }

    protected void preparedStatement_setParameterBefore(PreparedStatementProxy statement, int parameterIndex,
                                                        int sqlType, Object... values) {
        JdbcParameter parameter = new JdbcParameter(sqlType, values);

        getParameters(statement).put(parameterIndex, parameter);
    }
View Full Code Here

    private String buildSlowParameters(StatementProxy statement) {
        JSONWriter out = new JSONWriter();

        out.writeArrayStart();
        for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
            JdbcParameter parameter = statement.getParameter(i);
            if (i != 0) {
                out.writeComma();
            }
            if (parameter == null) {
                continue;
            }

            Object value = parameter.getValue();
            if (value == null) {
                out.writeNull();
            } else if (value instanceof String) {
                String text = (String) value;
                if (text.length() > 100) {
View Full Code Here

            return;
        }

        List<Object> parameters = new ArrayList<Object>(parametersSize);
        for (int i = 0; i < parametersSize; ++i) {
            JdbcParameter jdbcParam = statement.getParameter(i);
            parameters.add(jdbcParam.getValue());
        }

        String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
        String formattedSql = SQLUtils.format(sql, dbType, parameters);
        statementLog("{conn-" + statement.getConnectionProxy().getId() + ", " + stmtId(statement) + "} executed. \n"
View Full Code Here

                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Parameters : [");

                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }

                    int sqlType = parameter.getSqlType();
                    Object value = parameter.getValue();
                    switch (sqlType) {
                        case Types.NULL:
                            buf.append("NULL");
                            break;
                        default:
                            buf.append(String.valueOf(value));
                            break;
                    }
                }
                buf.append("]");
                statementLog(buf.toString());
            }
            {
                StringBuffer buf = new StringBuffer();
                buf.append("{conn-");
                buf.append(statement.getConnectionProxy().getId());
                buf.append(", ");
                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Types : [");
                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }
                    int sqlType = parameter.getSqlType();
                    buf.append(JdbcUtils.getTypeName(sqlType));
                }
                buf.append("]");
                statementLog(buf.toString());
            }
View Full Code Here

            return;
        }

        List<Object> parameters = new ArrayList<Object>(parametersSize);
        for (int i = 0; i < parametersSize; ++i) {
            JdbcParameter jdbcParam = statement.getParameter(i);
            parameters.add(jdbcParam.getValue());
        }

        String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
        String formattedSql = SQLUtils.format(sql, dbType, parameters);
        statementLog("{conn-" + statement.getConnectionProxy().getId() + ", " + stmtId(statement) + "} executed. "
View Full Code Here

                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Parameters : [");

                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }

                    int sqlType = parameter.getSqlType();
                    Object value = parameter.getValue();
                    switch (sqlType) {
                        case Types.NULL:
                            buf.append("NULL");
                            break;
                        default:
                            buf.append(String.valueOf(value));
                            break;
                    }
                }
                buf.append("]");
                statementLog(buf.toString());
            }
            {
                StringBuffer buf = new StringBuffer();
                buf.append("{conn-");
                buf.append(statement.getConnectionProxy().getId());
                buf.append(", ");
                buf.append(stmtId(statement));
                buf.append("}");
                buf.append(" Types : [");
                for (int i = 0, parametersSize = statement.getParametersSize(); i < parametersSize; ++i) {
                    JdbcParameter parameter = statement.getParameter(i);
                    if (i != 0) {
                        buf.append(", ");
                    }
                    if (parameter == null) {
                        continue;
                    }
                    int sqlType = parameter.getSqlType();
                    buf.append(JdbcUtils.getTypeName(sqlType));
                }
                buf.append("]");
                statementLog(buf.toString());
            }
View Full Code Here

TOP

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

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.