Class DatabaseUpdater

java.lang.Object
chemaxon.jchem.db.DatabaseUpdater

@PublicApi public class DatabaseUpdater extends Object
Class for upgrading JChem database structure.

Usage example:

 String message = "";
 ProgressWriter pw = ...;
 DatabaseUpdater databaseUpdater = new DatabaseUpdater(conh);
 DatabaseUpdater.DatabaseUpdateInfo updateInfo = null;
 while ((updateInfo = databaseUpdater.getNextUpdateInfo()) != null) {
     if (displayMessage(updateInfo)) {
        System.out.println("\n" + updateInfo.processingMessage + "\n");
          if (updateInfo.isProgressMonitoringSupported) {
            message = databaseUpdater.performCurrentUpdate(pw);
        } else {
            message = databaseUpdater.performCurrentUpdate();
        }
        System.out.println(message);
    } else if (updateInfo.isOperationRequired) {
      // stopping, since further updates may depend on this one
          break;
    }
}
 
Since:
JChem 3.2
  • Constructor Details

    • DatabaseUpdater

      public DatabaseUpdater(ConnectionHandler conh)
      Constructor.
      Parameters:
      conh - ConnectionHandler with live connection
      Since:
      JChem 3.2
    • DatabaseUpdater

      public DatabaseUpdater(ConnectionHandler conh, List<String> tablesToConsider)
      Similar to DatabaseUpdater(ConnectionHandler), but adds the ability for the user to specify a list of tables to which to restrict the operation of this DatabaseUpdater.
      Parameters:
      conh - ConnectionHandler with live connection
      tablesToConsider - include only these tables in the update.
      Since:
      JChem 3.2
  • Method Details