code: protected Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal)
              throws SQLException {
  
          ArrayList<Object> list = new ArrayList<Object>();
          Class componentType = arrayClass.getComponentType();
          RowMapper rowMapper = RowMapperFactory.getRowMapper(rs, componentType, cal);
  
          // a value of zero indicates that all rows from the resultset should be included.
          if (maxRows == 0) {
              maxRows = -1;
          }
  
          int numRows;
          boolean hasMoreRows = rs.next();
          for (numRows = 0; numRows != maxRows && hasMoreRows; numRows++) {
              list.add(rowMapper.mapRowToReturnType());
              hasMoreRows = rs.next();
          }
  
          Object array = Array.newInstance(componentType, numRows);
          try {
              for (int i = 0; i < numRows; i++) {
                  Array.set(array, i, list.get(i));
              }
          } catch (IllegalArgumentException iae) {
              ResultSetMetaData md = rs.getMetaData();
              // assuming no errors in resultSetObject() this can only happen
              // for single column result sets.
              throw new ControlException("The declared Java type for array " + componentType.getName()
                                         + "is incompatible with the SQL format of column " + md.getColumnName(1)
                                         + md.getColumnTypeName(1) + "which returns objects of type + "
                                         + list.get(0).getClass().getName());
          }
          return array;
      }
docs: Invoked when the return type of the method is an array type.
  
  @param rs         ResultSet to process.
  @param maxRows    The maximum size of array to create, a value of 0 indicates that the array
  size will be the same as the result set size (no limit).
  @param arrayClass The class of object contained within the array
  @param cal        A calendar instance to use for date/time values
  @return An array of the specified class type
  @throws SQLException On error.