public abstract class JdbcAction extends AbstractUpgradeAction
JDBC connections are created using the DataSource returned by getDataSource.
The JDBC connections have auto-commit disabled. Subclasses must explicitly commit to persist changes.
This class is thread-safe when the schema upgrade is performed through the
UpgradeDriverManager interface.
| Constructor and Description |
|---|
JdbcAction()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
analyze()
Subclasses should override
analyze(Connection). |
protected void |
analyze(Connection conn)
Called by
analyze. |
protected DataSource |
getDataSource()
Gets the DataSource used to create the JDBC connection.
|
protected void |
postEvent(Connection conn,
long id,
long classid,
int eventType,
int eventSubtype,
long longPayload)
Inserts a row into
odmz_event, using the specified connection. |
void |
postUpgrade()
Subclasses should override
postUpgrade(Connection). |
protected void |
postUpgrade(Connection conn)
Called by
postUpgrade. |
void |
preUpgrade()
Subclasses should override
preUpgrade(Connection). |
protected void |
preUpgrade(Connection conn)
Called by
preUpgrade. |
void |
rollback(boolean downgrade)
Subclasses should override
rollback(Connection, boolean). |
protected void |
rollback(Connection conn,
boolean downgrade)
Called by
rollback. |
void |
upgrade()
Subclasses should override
upgrade(Connection). |
protected void |
upgrade(Connection conn)
Called by
upgrade. |
getName, getProperties, getProperty, getUpgradeActionContext, initializepublic final void analyze()
throws IfsException
analyze(Connection).analyze in interface UpgradeActionanalyze in class AbstractUpgradeActionIfsException - 82101: if the operation failspublic final void preUpgrade()
throws IfsException
preUpgrade(Connection).preUpgrade in interface UpgradeActionpreUpgrade in class AbstractUpgradeActionIfsException - 82102: if the operation failspublic final void upgrade()
throws IfsException
upgrade(Connection).upgrade in interface UpgradeActionupgrade in class AbstractUpgradeActionIfsException - 82103: if the operation failspublic final void postUpgrade()
throws IfsException
postUpgrade(Connection).postUpgrade in interface UpgradeActionpostUpgrade in class AbstractUpgradeActionIfsException - 82104: if the operation failspublic final void rollback(boolean downgrade)
throws IfsException
rollback(Connection, boolean).rollback in interface UpgradeActionrollback in class AbstractUpgradeActiondowngrade - whether the rollback is being performed as part of
a downgradeIfsException - 82105: if the operation failsprotected void analyze(Connection conn) throws IfsException, SQLException
analyze.
Subclasses should override this method to perform the analysis phase of the upgrade action.
conn - the JDBC connectionIfsException - if the operation failsSQLException - if the operation failsprotected void preUpgrade(Connection conn) throws IfsException, SQLException
preUpgrade.
Subclasses should override this method to perform the pre-upgrade phase of the upgrade action.
conn - the JDBC connectionIfsException - if the operation failsSQLException - if the operation failsprotected void upgrade(Connection conn) throws IfsException, SQLException
upgrade.
Subclasses should override this method to perform the upgrade phase of the upgrade action.
conn - the JDBC connectionIfsException - if the operation failsSQLException - if the operation failsprotected void postUpgrade(Connection conn) throws IfsException, SQLException
postUpgrade.
Subclasses should override this method to perform the post-upgrade phase of the upgrade action.
conn - the JDBC connectionIfsException - if the operation failsSQLException - if the operation failsprotected void rollback(Connection conn, boolean downgrade) throws IfsException, SQLException
rollback.
Subclasses should override this method to rollback the analysis and pre-upgrade phases of the upgrade action.
conn - the JDBC connectiondowngrade - whether the rollback is being performed as part of
a downgradeIfsException - if the operation failsSQLException - if the operation failsprotected DataSource getDataSource() throws IfsException
In this class, returns the DataSource for connecting to the repository. Subclasses can override this method to return a different DataSource.
IfsException - if the operation failsprotected void postEvent(Connection conn, long id, long classid, int eventType, int eventSubtype, long longPayload) throws IfsException
odmz_event, using the specified connection.conn - the connectionid - the idclassid - the class ideventType - the event typeeventSubtype - the event sub-typelongPayload - the event payloadIfsException - if the operation failsCopyright © 2025. All rights reserved.