Package chemaxon.jchem.db
Class DatabaseUpdater
java.lang.Object
chemaxon.jchem.db.DatabaseUpdater
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass describing the nature of an update. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DatabaseUpdater(ConnectionHandler conh, List<String> tablesToConsider) Similar toDatabaseUpdater(ConnectionHandler), but adds the ability for the user to specify a list of tables to which to restrict the operation of thisDatabaseUpdater. -
Method Summary
Modifier and TypeMethodDescriptionReturns the update information for the next update step.Returns the update information for the next update step.booleanisUpdateNeededForTable(String tableName) Check whether structural upgrade is necessary for a particular table.static voidmodifyExtColumnInOraclePropertyTable(ConnectionHandler connectionHandler) Performs the current update operation.Performs the current update operation with progress monitoring where supported.
-
Constructor Details
-
DatabaseUpdater
Constructor.- Parameters:
conh- ConnectionHandler with live connection- Since:
- JChem 3.2
-
DatabaseUpdater
Similar toDatabaseUpdater(ConnectionHandler), but adds the ability for the user to specify a list of tables to which to restrict the operation of thisDatabaseUpdater.- Parameters:
conh- ConnectionHandler with live connectiontablesToConsider- include only these tables in the update.- Since:
- JChem 3.2
-
-
Method Details
-
getNextUpdateInfo
Returns the update information for the next update step.- Returns:
- the message, or
null, if there are no more updates left - Throws:
SQLException- if an error occurs- See Also:
-
getNextUpdateInfo
Returns the update information for the next update step.- Parameters:
pw- the progress writer- Returns:
- the message, or
null, if there are no more updates left - Throws:
SQLException- if an error occurs- Since:
- JChem 5.9
- See Also:
-
isUpdateNeededForTable
Check whether structural upgrade is necessary for a particular table.- Parameters:
tableName- Name of the structure table.- Returns:
- True, if upgrade is needed.
- Throws:
SQLException- if an error occurs
-
performCurrentUpdate
Performs the current update operation.- Returns:
- a status message
- Throws:
SQLException- if an error occurs- See Also:
-
performCurrentUpdate
Performs the current update operation with progress monitoring where supported.- Parameters:
pw- the progress writer- Returns:
- a status message
- Throws:
SQLException- if an error occurs- Since:
- JChem 5.1.2
- See Also:
-
modifyExtColumnInOraclePropertyTable
public static void modifyExtColumnInOraclePropertyTable(ConnectionHandler connectionHandler) throws SQLException - Throws:
SQLException
-