code: public static void collectDataForLog( IHMConnection connection, GpsLog log ) throws Exception {
          long logId = log.id;
  
          String query = "select "
                  + //
                  GpsLogsDataTableFields.COLUMN_DATA_LAT.getFieldName() + ","
                  + //
                  GpsLogsDataTableFields.COLUMN_DATA_LON.getFieldName() + ","
                  + //
                  GpsLogsDataTableFields.COLUMN_DATA_ALTIM.getFieldName() + ","
                  + //
                  GpsLogsDataTableFields.COLUMN_DATA_TS.getFieldName()
                  + //
                  " from " + TABLE_GPSLOG_DATA + " where "
                  + //
                  GpsLogsDataTableFields.COLUMN_LOGID.getFieldName() + " = " + logId + " order by "
                  + GpsLogsDataTableFields.COLUMN_DATA_TS.getFieldName();
  
          try (IHMStatement newStatement = connection.createStatement(); IHMResultSet result = newStatement.executeQuery(query);) {
              newStatement.setQueryTimeout(30);
  
              while( result.next() ) {
                  double lat = result.getDouble(1);
                  double lon = result.getDouble(2);
                  double altim = result.getDouble(3);
                  long ts = result.getLong(4);
  
                  GpsPoint gPoint = new GpsPoint();
                  gPoint.lon = lon;
                  gPoint.lat = lat;
                  gPoint.altim = altim;
                  gPoint.utctime = ts;
                  log.points.add(gPoint);
              }
          }
      }
docs: Gather gps points data for a supplied log.
  
  @param connection the connection to use.
  @param log the log.
  @throws Exception