private static void loadTraceEvents(final CConnection connection,final TraceList traceList,final List<? extends INaviModule> modules) throws SQLException {
  final List<List<TraceRegister>> values=loadTraceEventValues(connection,traceList);
  final String query="select tid, module_id, address, type from " + CTableNames.TRACE_EVENT_TABLE + " where trace_id = "+ traceList.getId()+ " order by position asc";
  final ResultSet resultSet=connection.executeQuery(query,true);
  int counter=0;
  try {
    while (resultSet.next()) {
      final long tid=resultSet.getLong("tid");
      final int moduleId=resultSet.getInt("module_id");
      final INaviModule module=resultSet.wasNull() ? null : findModule(modules,moduleId);
      final BreakpointAddress address=new BreakpointAddress(module,new UnrelocatedAddress(PostgreSQLHelpers.loadAddress(resultSet,"address")));
      final int event=resultSet.getInt("type");
      traceList.addEvent(new TraceEvent(tid,address,TraceEventType.parseInt(event),values.isEmpty() ? new ArrayList<TraceRegister>() : values.get(counter)));
      counter++;
    }
  }
  finally {
    resultSet.close();
  }
}

private static void loadTraceEvents ( final CConnection connection , final TraceList traceList , final List < ? extends INaviModule > modules ) throws SQLException { final List < List < TraceRegister > > values = loadTraceEventValues ( connection , traceList ) ; final String query = "select tid, module_id, address, type from " + CTableNames . TRACE_EVENT_TABLE + " where trace_id = " + traceList . getId ( ) + " order by position asc" ; final ResultSet resultSet = connection . executeQuery ( query , true ) ; int counter = 0 ; try { while ( resultSet . next ( ) ) { final long tid = resultSet . getLong ( "tid" ) ; final int moduleId = resultSet . getInt ( "module_id" ) ; final INaviModule module = resultSet . wasNull ( ) ? null : findModule ( modules , moduleId ) ; final BreakpointAddress address = new BreakpointAddress ( module , new UnrelocatedAddress ( PostgreSQLHelpers . loadAddress ( resultSet , "address" ) ) ) ; final int event = resultSet . getInt ( "type" ) ; traceList . addEvent ( new TraceEvent ( tid , address , TraceEventType . parseInt ( event ) , values . isEmpty ( ) ? new ArrayList < TraceRegister > ( ) : values . get ( counter ) ) ) ; counter ++ ; } } finally { resultSet . close ( ) ; } }
loads the trace events of a trace list from the database .
