code: private static RowMapper getMapper(Class<? extends RowMapper> rowMapper, ResultSet rs, Class returnType, Calendar cal)
      {
          Constructor c = null;
          try {
              c = rowMapper.getDeclaredConstructor(_params);
              return (RowMapper) c.newInstance(new Object[]{rs, returnType, cal});
          } catch (NoSuchMethodException e) {
              throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
          } catch (InstantiationException e) {
              throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
          } catch (IllegalAccessException e) {
              throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
          } catch (InvocationTargetException e) {
              throw new ControlException("Failure creating new instance of RowMapper, " + e.getCause().toString(), e);
          }
      }
docs: Create an instance of the RowMapper class.
  
  @param rowMapper
  @param rs         ResultSet we are mapping from.
  @param returnType Class to map rows to.
  @param cal        Calendar instance for date/time values.
  @return A RowMapper instance.