예제 #1
0
 private void doUseTable(String tableName) {
   if (currTable != null) {
     int changes = currTable.countChanges();
     if (changes != 0) {
       System.out.println(changes + " unsaved changes");
       return;
     }
   }
   try {
     DataBase tmp = (DataBase) prov.getTable(tableName);
     if (tmp == null) {
       System.out.println(tableName + " not exists");
     } else {
       if (currTable != null) {
         currTable.unloadData();
       }
       currTable = tmp;
       System.out.println("using " + tableName);
     }
   } catch (IllegalArgumentException e) {
     System.out.println(e.getMessage());
   }
 }