public static UpdateReferenceDataData[] select(
      ConnectionProvider connectionProvider, int firstRegister, int numberRegisters)
      throws ServletException {
    String strSql = "";
    strSql =
        strSql
            + "      SELECT '' as id, '' as NAME, '' AS HASCHARTOFACCOUNTS, '' AS  ISTRANSLATIONMODULE,"
            + "      '' AS AD_MODULE_ID, '' AS PATH, '' AS  JAVAPACKAGE, '' AS DATASETNAME, '' AS VERSION, '' AS CHECKSUM"
            + "      FROM DUAL";

    ResultSet result;
    Vector<java.lang.Object> vector = new Vector<java.lang.Object>(0);
    PreparedStatement st = null;

    try {
      st = connectionProvider.getPreparedStatement(strSql);

      result = st.executeQuery();
      long countRecord = 0;
      long countRecordSkip = 1;
      boolean continueResult = true;
      while (countRecordSkip < firstRegister && continueResult) {
        continueResult = result.next();
        countRecordSkip++;
      }
      while (continueResult && result.next()) {
        countRecord++;
        UpdateReferenceDataData objectUpdateReferenceDataData = new UpdateReferenceDataData();
        objectUpdateReferenceDataData.id = UtilSql.getValue(result, "id");
        objectUpdateReferenceDataData.name = UtilSql.getValue(result, "name");
        objectUpdateReferenceDataData.haschartofaccounts =
            UtilSql.getValue(result, "haschartofaccounts");
        objectUpdateReferenceDataData.istranslationmodule =
            UtilSql.getValue(result, "istranslationmodule");
        objectUpdateReferenceDataData.adModuleId = UtilSql.getValue(result, "ad_module_id");
        objectUpdateReferenceDataData.path = UtilSql.getValue(result, "path");
        objectUpdateReferenceDataData.javapackage = UtilSql.getValue(result, "javapackage");
        objectUpdateReferenceDataData.datasetname = UtilSql.getValue(result, "datasetname");
        objectUpdateReferenceDataData.version = UtilSql.getValue(result, "version");
        objectUpdateReferenceDataData.checksum = UtilSql.getValue(result, "checksum");
        objectUpdateReferenceDataData.InitRecordNumber = Integer.toString(firstRegister);
        vector.addElement(objectUpdateReferenceDataData);
        if (countRecord >= numberRegisters && numberRegisters != 0) {
          continueResult = false;
        }
      }
      result.close();
    } catch (SQLException e) {
      log4j.error("SQL error in query: " + strSql + "Exception:" + e);
      throw new ServletException(
          "@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
    } catch (Exception ex) {
      log4j.error("Exception in query: " + strSql + "Exception:" + ex);
      throw new ServletException("@CODE=@" + ex.getMessage());
    } finally {
      try {
        connectionProvider.releasePreparedStatement(st);
      } catch (Exception ignore) {
        ignore.printStackTrace();
      }
    }
    UpdateReferenceDataData objectUpdateReferenceDataData[] =
        new UpdateReferenceDataData[vector.size()];
    vector.copyInto(objectUpdateReferenceDataData);
    return (objectUpdateReferenceDataData);
  }
  public static UpdateReferenceDataData[] selectOrganization(
      ConnectionProvider connectionProvider,
      String rol,
      String adOrgClient,
      int firstRegister,
      int numberRegisters)
      throws ServletException {
    String strSql = "";
    strSql =
        strSql
            + "       SELECT A_O.AD_ORG_ID AS ID, A_O.NAME "
            + "       FROM AD_ORG A_O, AD_ROLE_ORGACCESS A_R_O, AD_ROLE R "
            + "       WHERE A_R_O.AD_ORG_ID = A_O.AD_ORG_ID "
            + "       AND A_R_O.ISACTIVE = 'Y' "
            + "       AND A_R_O.AD_ROLE_ID = R.AD_ROLE_ID "
            + "       AND R.ISACTIVE = 'Y'"
            + "       AND A_R_O.AD_ROLE_ID = ? "
            + "       AND A_O.AD_Org_ID IN(";
    strSql = strSql + ((adOrgClient == null || adOrgClient.equals("")) ? "" : adOrgClient);
    strSql = strSql + ")" + "       ORDER BY A_O.NAME";

    ResultSet result;
    Vector<java.lang.Object> vector = new Vector<java.lang.Object>(0);
    PreparedStatement st = null;

    int iParameter = 0;
    try {
      st = connectionProvider.getPreparedStatement(strSql);
      iParameter++;
      UtilSql.setValue(st, iParameter, 12, null, rol);
      if (adOrgClient != null && !(adOrgClient.equals(""))) {}

      result = st.executeQuery();
      long countRecord = 0;
      long countRecordSkip = 1;
      boolean continueResult = true;
      while (countRecordSkip < firstRegister && continueResult) {
        continueResult = result.next();
        countRecordSkip++;
      }
      while (continueResult && result.next()) {
        countRecord++;
        UpdateReferenceDataData objectUpdateReferenceDataData = new UpdateReferenceDataData();
        objectUpdateReferenceDataData.id = UtilSql.getValue(result, "id");
        objectUpdateReferenceDataData.name = UtilSql.getValue(result, "name");
        objectUpdateReferenceDataData.InitRecordNumber = Integer.toString(firstRegister);
        vector.addElement(objectUpdateReferenceDataData);
        if (countRecord >= numberRegisters && numberRegisters != 0) {
          continueResult = false;
        }
      }
      result.close();
    } catch (SQLException e) {
      log4j.error("SQL error in query: " + strSql + "Exception:" + e);
      throw new ServletException(
          "@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
    } catch (Exception ex) {
      log4j.error("Exception in query: " + strSql + "Exception:" + ex);
      throw new ServletException("@CODE=@" + ex.getMessage());
    } finally {
      try {
        connectionProvider.releasePreparedStatement(st);
      } catch (Exception ignore) {
        ignore.printStackTrace();
      }
    }
    UpdateReferenceDataData objectUpdateReferenceDataData[] =
        new UpdateReferenceDataData[vector.size()];
    vector.copyInto(objectUpdateReferenceDataData);
    return (objectUpdateReferenceDataData);
  }