int position = -1;  Iterator iter = outputParams.iterator(); while(iter.hasNext()) { FBProcedureParam param = (FBProcedureParam)iter.next();  if (param != null && param.isParam()) { position++;  if (param.getIndex() == index) return position + 1; } }      if (position == -1 && OLD_CALLABLE_STATEMENT_COMPATIBILITY) return index; else if (position == -1) throw new FBSQLException("Specified parameter does not exist.", FBSQLException.SQL_STATE_INVALID_COLUMN); else return position;
return mapOutParamIndexToPosition(index, OLD_CALLABLE_STATEMENT_COMPATIBILITY);
    public int mapOutParamIndexToPosition(int index) throws FBSQLException {    	int position = -1;                Iterator iter = outputParams.iterator();        while(iter.hasNext()) {        	FBProcedureParam param = (FBProcedureParam)iter.next();                        if (param != null && param.isParam()) {               position++;                              if (param.getIndex() == index)               	    return position + 1;            }        }                // hack: if we did not find the right parameter we return        // an index that was asked if we run in compatibilty mode        //         // we should switch it off as soon as people convert applications        if (position == -1 && OLD_CALLABLE_STATEMENT_COMPATIBILITY)            return index;        else         if (position == -1)            throw new FBSQLException("Specified parameter does not exist.",                     FBSQLException.SQL_STATE_INVALID_COLUMN);        else        	return position;    }