public void setParameter(final int parameterIndex, final ParameterHolder holder)
      throws SQLException {
    if (parameterIndex >= 1 && parameterIndex < prepareResult.getParamCount() + 1) {
      parameters[parameterIndex - 1] = holder;
    } else {
      String error = "Could not set parameter at position " + parameterIndex
          + " (values was " + holder.toString() + ")\n"
          + "Query - conn:" + protocol.getServerThreadId()
          + "(" + (protocol.isMasterConnection() ? "M" : "S") + ") ";

      if (options.maxQuerySizeToLog > 0) {
        error += " - \"";
        if (sqlQuery.length() < options.maxQuerySizeToLog) {
          error += sqlQuery;
        } else {
          error += sqlQuery.substring(0, options.maxQuerySizeToLog) + "...";
        }
        error += "\"";
      } else {
        error += " - \"" + sqlQuery + "\"";
      }

      logger.error(error);
      throw ExceptionMapper.getSqlException(error);
    }
  }
public void setParameter ( final int parameterIndex , final ParameterHolder holder ) throws SQLException { if ( parameterIndex >= 1 && parameterIndex < prepareResult . getParamCount ( ) + 1 ) { parameters [ parameterIndex - 1 ] = holder ; } else { String error = "Could not set parameter at position " + parameterIndex + " (values was " + holder . toString ( ) + ")\n" + "Query - conn:" + protocol . getServerThreadId ( ) + "(" + ( protocol . isMasterConnection ( ) ? "M" : "S" ) + ") " ; if ( options . maxQuerySizeToLog > 0 ) { error += " - \"" ; if ( sqlQuery . length ( ) < options . maxQuerySizeToLog ) { error += sqlQuery ; } else { error += sqlQuery . substring ( 0 , options . maxQuerySizeToLog ) + "..." ; } error += "\"" ; } else { error += " - \"" + sqlQuery + "\"" ; } logger . error ( error ) ; throw ExceptionMapper . getSqlException ( error ) ; } }
Set parameter.

@param parameterIndex index
@param holder         parameter holder
@throws SQLException if index position doesn't correspond to query parameters