Package org.h2.expression

Examples of org.h2.expression.ParameterInterface


     */
    public void reuse() {
        canReuse = false;
        ArrayList<? extends ParameterInterface> parameters = getParameters();
        for (int i = 0, size = parameters.size(); i < size; i++) {
            ParameterInterface param = parameters.get(i);
            param.setValue(null, true);
        }
    }
View Full Code Here


        try {
            debugCodeCall("clearParameters");
            checkClosed();
            ArrayList<? extends ParameterInterface> parameters = command.getParameters();
            for (int i = 0, size = parameters.size(); i < size; i++) {
                ParameterInterface param = parameters.get(i);
                // can only delete old temp files if they are not in the batch
                param.setValue(null, batchParameters == null);
            }
        } catch (Exception e) {
            throw logAndConvert(e);
        }
    }
View Full Code Here

                for (int i = 0; i < size; i++) {
                    Value[] set = batchParameters.get(i);
                    ArrayList<? extends ParameterInterface> parameters = command.getParameters();
                    for (int j = 0; j < set.length; j++) {
                        Value value = set[j];
                        ParameterInterface param = parameters.get(j);
                        param.setValue(value, false);
                    }
                    try {
                        result[i] = executeUpdateInternal();
                    } catch (Exception re) {
                        SQLException e = logAndConvert(re);
View Full Code Here

            try {
                ArrayList<? extends ParameterInterface> parameters = command.getParameters();
                int size = parameters.size();
                Value[] set = new Value[size];
                for (int i = 0; i < size; i++) {
                    ParameterInterface param = parameters.get(i);
                    Value value = param.getParamValue();
                    set[i] = value;
                }
                if (batchParameters == null) {
                    batchParameters = New.arrayList();
                }
View Full Code Here

        parameterIndex--;
        ArrayList<? extends ParameterInterface> parameters = command.getParameters();
        if (parameterIndex < 0 || parameterIndex >= parameters.size()) {
            throw DbException.getInvalidValueException("parameterIndex", parameterIndex + 1);
        }
        ParameterInterface param = parameters.get(parameterIndex);
        // can only delete old temp files if they are not in the batch
        param.setValue(value, batchParameters == null);
    }
View Full Code Here

            // if the session was re-connected, re-prepare the statement
            ArrayList<? extends ParameterInterface> oldParams = command.getParameters();
            command = conn.prepareCommand(sqlStatement, fetchSize);
            ArrayList<? extends ParameterInterface> newParams = command.getParameters();
            for (int i = 0, size = oldParams.size(); i < size; i++) {
                ParameterInterface old = oldParams.get(i);
                Value value = old.getParamValue();
                if (value != null) {
                    ParameterInterface n = newParams.get(i);
                    n.setValue(value, false);
                }
            }
            return true;
        }
        return false;
View Full Code Here

     * @return the data type
     */
    public int getParameterType(int param) throws SQLException {
        try {
            debugCodeCall("getParameterType", param);
            ParameterInterface p = getParameter(param);
            int type = p.getType();
            if (type == Value.UNKNOWN) {
                type = Value.STRING;
            }
            return DataType.getDataType(type).sqlType;
        } catch (Exception e) {
View Full Code Here

     * @return the precision
     */
    public int getPrecision(int param) throws SQLException {
        try {
            debugCodeCall("getPrecision", param);
            ParameterInterface p = getParameter(param);
            return MathUtils.convertLongToInt(p.getPrecision());
        } catch (Exception e) {
            throw logAndConvert(e);
        }
    }
View Full Code Here

     * @return the scale
     */
    public int getScale(int param) throws SQLException {
        try {
            debugCodeCall("getScale", param);
            ParameterInterface p = getParameter(param);
            return p.getScale();
        } catch (Exception e) {
            throw logAndConvert(e);
        }
    }
View Full Code Here

     * @return the Java class name
     */
    public String getParameterClassName(int param) throws SQLException {
        try {
            debugCodeCall("getParameterClassName", param);
            ParameterInterface p = getParameter(param);
            int type = p.getType();
            if (type == Value.UNKNOWN) {
                type = Value.STRING;
            }
            return DataType.getTypeClassName(type);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.h2.expression.ParameterInterface

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.