public class UpgradeOperations extends ScriptOperations
ScriptOperations.ClassObjectOptions, ScriptOperations.JdbcExecutor, ScriptOperations.SavedSearchResult, ScriptOperations.ServerDefinition, ScriptOperations.ServiceDefinition
INDENT
Constructor and Description |
---|
UpgradeOperations(ScriptDriver driver)
Constructs an UpgradeOperations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addColumnIfNecessary(IfsConnection conn,
String tableName,
String columnName,
String rdbmsDataType)
Alter the specified table to add a new column.
|
void |
addTableColumn(AttributeValueTable avt)
Alter a table to add a new column to a table.
|
protected void |
analyze(IfsConnection conn,
String schemaName)
Analyze a schema.
|
protected void |
analyzeTable(IfsConnection conn,
String schemaName,
String tableName)
Analyze a table in a schema.
|
protected void |
closeResultSet(ResultSet rset)
Close a ResultSet, ignoring any Exceptions.
|
protected void |
closeStatement(StatementWrapper stmt)
Close a StatementWrapper, ignoring any Exceptions.
|
protected boolean |
columnExists(IfsConnection conn,
String tableName,
String columnName)
Return true if the specified column exists in the specified table.
|
protected void |
commit(IfsConnection conn)
Issue a commit.
|
void |
copyToExistingMapAttribute(AttributeValueTable avt)
Copy the data from an existing scalar Attribute into an existing
map Attribute defined with a consisent data type.
|
void |
copyToNewMapAttribute(AttributeValueTable avt)
Copy the data from an existing scalar Attribute into a new Attribute
defined in a previous call to
defineAttribute ,
which will get added as a new Attribute as part of this operation. |
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String[] columns,
boolean isUnique)
Create an index on n columns of a table.
|
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String[] columns,
boolean isUnique,
boolean dropAndRetryIfExists,
boolean ignoreIfEquivalent)
Create an index on n columns of a table.
|
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String columnName,
boolean isUnique)
Create an index on a column of a table.
|
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String columnName,
boolean isUnique,
boolean dropAndRetryIfExists,
boolean ignoreIfEquivalent)
Create an index on a column of a table.
|
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String columnName1,
String columnName2,
boolean isUnique)
Create an index on 2 columns of a table.
|
protected void |
createIndex(IfsConnection conn,
String indexName,
String tableName,
String columnName1,
String columnName2,
boolean isUnique,
boolean dropAndRetryIfExists,
boolean ignoreIfEquivalent)
Create an index on 2 columns of a table.
|
protected void |
createSequence(IfsConnection conn,
String seqName,
int initialValue,
int cacheSize)
Create a sequence.
|
protected void |
createSequence(IfsConnection conn,
String seqName,
int initialValue,
int cacheSize,
boolean dropFirst)
Create a sequence, optionally attempting to drop the seqeunce first.
|
protected void |
createTable(IfsConnection conn,
String tableName,
String createStmt)
Create a table.
|
protected void |
createTable(IfsConnection conn,
String tableName,
String createStmt,
boolean dropFirst)
Create a table, optionally attempting to drop the table first.
|
protected void |
createView(IfsConnection conn,
String viewName,
String createStmt)
Create a view.
|
protected void |
dropIndex(IfsConnection conn,
String indexName)
Drop an index.
|
protected void |
dropSequence(IfsConnection conn,
String seqName)
Drop a sequence
|
protected void |
dropTable(IfsConnection conn,
String tableName)
Drop a table.
|
protected void |
dropView(IfsConnection conn,
String viewName)
Drop a view.
|
protected void |
executeStatement(IfsConnection conn,
String stmtString)
Execute any SQL statement
|
protected int |
executeUpdate(IfsConnection conn,
String stmtString)
Execute an update statement.
|
protected String |
getColumnList(String[] cols)
Return the concatenation of the specified columns as a
comma-separated column list.
|
protected long |
getNextSequenceValue(IfsConnection conn,
String seqName)
Get a value from a sequence.
|
protected String |
getUpdateSql(String tableName,
String[] pkCols,
String updateClause)
Return the SQL used to update row that can be identified uniquely.
|
protected String |
getUpdateWhereClause(String[] cols)
Return the clause to use in the SQL update's where clause
to uniquely identify the row to be updated.
|
protected Object |
getValueFromResultSet(ResultSet rset,
int pos,
int dataType)
Returns the value from a ResultSet for the position and type indicated.
|
protected void |
initializeColumns(IfsConnection conn,
String tableName,
String[] pkCols,
int[] pkColTypes,
String selCondition,
String updColClause,
int batchSize)
Initialize the newly added columns by selecting and updating rows in
batches.
|
protected boolean |
isValidConnection(IfsConnection conn)
Test validity of a IfsConnection
|
void |
renameAttributeColumnName(AttributeValueTable avt)
Renames the column name (i.e. databaseobjectname) for an Attribute of a ClassObject.
|
protected void |
renameAttributeDatabaseObjectName(IfsConnection conn,
Long attrId,
String newColumnName)
Rename the DATABASEOBJECTNAME value for the specified Attribute ID.
|
protected void |
renameColumn(IfsConnection conn,
String tableName,
String columnName,
String newColumnName)
Alter the specified table to rename a column.
|
void |
renameTableColumn(AttributeValueTable avt)
Alter a table to rename a column.
|
protected void |
rollback(IfsConnection conn)
Issue a rollback.
|
protected boolean |
rowExists(IfsConnection conn,
String tableName,
String condition)
Return true if there is a row that meets the specified condition
for the specified table.
|
protected boolean |
rowExists(IfsConnection conn,
String tableName,
String condition,
boolean errorValue)
Return true if there is a row that meets the specified condition
for the specified table.
|
protected List<Object[]> |
selectPrimaryKeyBatch(IfsConnection conn,
long lastId,
int batchSize,
String tableName,
String[] selCols,
int[] selTypes,
String selCondition,
String pkOperator)
Select a batch of tuples restricted by Primary Key.
|
protected void |
setValueInStatement(IfsPreparedStatement stmt,
int dataType,
Object value,
int position)
Set bind values in the specified statement.
|
protected boolean |
tableExists(IfsConnection conn,
String tableName)
Return true if the specified table exists.
|
abortTransaction, acquireLock, acquireManualLock, activateAuditHandlerSpecification, activateAuditSpecification, activateOperationActionSpecification, activateServerSpecification, activateSystemObject, addAttachment, addAttribute, addAuditEventProperty, addAuditType, addAuditTypesForClass, addBooleanHandlerProperty, addCategory, addDefinitionAuditEntryType, addDefinitionAuditEntryTypesForClass, addDefinitionAuditEntryTypesUnderClass, addDefinitionBooleanProperty, addDefinitionDoubleProperty, addDefinitionIntegerProperty, addDefinitionLongProperty, addDefinitionProperties, addDefinitionProperty, addDefinitionStringArrayProperty, addDefinitionStringProperty, addDocumentDefinitionCharacterSet, addDocumentDefinitionContent, addDocumentDefinitionContentBfileReference, addDocumentDefinitionLanguage, addGlobalOperationActionSpecification, addGroupMember, addGroupMembers, addIntegerHandlerProperty, addLifecyclePolicyEntryDefinition, addLifecyclePolicyEntryDefinition, addLongHandlerProperty, addManagedServerDeclaration, addManagedServerDeclaration, addManagedServerDeclaration, addManagedServiceDeclaration, addManagedServiceDeclaration, addPreparedSelectorBindValue, addPreparedSelectorBooleanBindValue, addPreparedSelectorIntegerBindValue, addPreparedSelectorLibraryObjectBindValue, addPreparedSelectorLongBindValue, addPreparedSelectorStringBindValue, addPublicObjectDefinitionCategory, addSchemaObjectDefinitionCategory, addStringArrayHandlerProperty, addStringHandlerProperty, addSystemObjectDefinitionBooleanProperty, addSystemObjectDefinitionCategory, addSystemObjectDefinitionIntegerProperty, addSystemObjectDefinitionLongProperty, addSystemObjectDefinitionStringArrayProperty, addSystemObjectDefinitionStringProperty, addToDocumentDefinition, addToPublicObjectDefinition, applyLogLevelOverride, applyNamedFreezeLock, applySingletonLock, assignClassDomain, assignLifecyclePolicyByCategory, assignValueDefault, assignValueDomain, beginTransaction, businessObjectExists, clearImpersonateUser, clearSharedCaches, cloneCurrentSession, cloneDefinition, cloneDefinition, comment, comment, compareObjects, completeTransaction, concatenateObjectId, concatenateStrings, concatenateStrings, concatenateStrings, concatenateStrings, concatenateStrings, concatenateStrings, concatenateStrings, concatenateToLowerStrings, concatenateToLowerStrings, concatenateToLowerStrings, concatenateToUpperStrings, concatenateToUpperStrings, concatenateToUpperStrings, connect, connect, constructAuditEvent, constructPreparedSelectorGenerator, constructPreparedSelectorGenerator, convertPropertyDefinitionsToHashtable, convertStringArray, convertToBoolean, convertToBoolean, convertToDouble, convertToDouble, convertToInteger, convertToInteger, convertToLong, convertToLong, convertToRelativePath, copy, create, createAccessControlList, createAndApplyAuditTypeList, createApplicationToken, createApplicationToken, createAuditSpecification, createAuditSpecification, createAuditSpecification, createAuditSpecification, createAuditTypeList, createAuditTypeList, createAutoFolderingActionSpecification, createAutoFolderingActionSpecification, createCategorizedDocument, createClassDomain, createClassObject, createClassObject, createCustomLockEntry, createCustomMediaDriverSpecification, createCustomMediaDriverSpecification, createDefinition, createDefinitionFromDefinitionObject, createDefinitionFromObject, createDefinitionObject, createDependentView, createDocument, createDocument, createDocument, createDocumentBatch, createDocuments, createEntireAuditSpecification, createExtendedPermission, createExtendedUserProfile, createFolder, createFolder, createFolder, createFolderLink, createFolderTree, createFormat, createGroup, createGuestSession, createLibraryObject, createLibraryObject, createLifecycleDateRuleSpecification, createLifecycleDateRuleSpecification, createLifecyclePolicy, createLifecyclePolicy, createLifecyclePolicyActionSpecification, createLifecyclePolicyActionSpecification, createLifecyclePolicyEntryDefinition, createLink, createLink, createLink, createLockTypeLookupTables, createMedia, createMedia, createNamedFreezeLock, createNamedPropertyBundle, createNodeConfiguration, createNodeConfiguration, createOperationActionSpecification, createOperationActionSpecification, createOrUpdateClassObject, createPermissionBundle, createPolicy, createPolicyList, createPropertyBundle, createQueue, createRetentionPolicy, createServerConfiguration, createServerConfiguration, createServerSpecification, createServiceConfiguration, createServiceConfiguration, createSession, createSession, createSimplePropertyTable, createSimplePropertyTableList, createStorageGroup, createStorageGroup, createSystemLockObject, createUser, createUserSession, createValueDefault, createValueDomain, deactivateAuditHandlerSpecification, deactivateAuditSpecification, deactivateOperationActionSpecification, deactivateServerSpecification, deactivateSystemObject, deactivateUnknownOperationActionSpecifications, defineAttribute, defineAuditHandlerSpecificationDefinition, defineAuditHandlerSpecificationDefinition, defineAuditTargetSpecificationDefinition, defineAuditTypeListDefinition, defineAuditTypeListDefinition, defineClassObject, defineExistingClassObject, definitionExists, deleteAllCategories, deleteAuditSpecification, deleteNamedFreezeLock, deleteRepositoryParameter, deleteUser, deregisterBusinessObject, deregisterCustomLockType, deregisterDefinition, deregisterLockType, deregisterObject, deregisterSession, deregisterTransaction, determinePrimaryObjectColumnAlias, ensureFreed, executeAutocommitSql, executePreparedSelect, executePreparedSelect, executePreparedSelect, executePreparedSelect, executePreparedSelectCount, executePreparedSelectCount, executePreparedSelectCount, executePreparedSelectFromJson, executePreparedSelectResults, exists, existsRelative, extractContentForIndexing, findOrCreateCompositeGroup, freeClassDomain, freeClassObject, freeExtendedPermission, freeFolder, freeFormat, freeNamedPropertyBundle, freeNamedPropertyBundle, freeNodeConfiguration, freeNodeConfiguration, freeObject, freePermissionBundle, freePolicy, freeServerConfiguration, freeServerConfiguration, freeServiceConfiguration, freeServiceConfiguration, freeUnreferencedContent, freeValueDefault, freeValueDomain, generateClassObjectDefinitionTag, getAbsolutePath, getAclValueForConfigurationObjects, getAttributeValue, getAttributeValue, getAttributeValue, getAuditDriverHelper, getAuditEventDispatcher, getAuditingStartingId, getAuxiliaryTargets, getBindValues, getBypassSecurityAliases, getClassObjectCreationMode, getConsoleInputBoolean, getConsoleInputString, getConsoleInputString, getConsoleInputString, getConsoleSecureInputString, getContentPath, getCurrentSession, getDriver, getIncludedFileSettings, getLogWriter, getManagedServerDeclarations, getManagedServiceDeclarations, getParameterTable, getSavedSearchResultPrimaryObjects, getSavedSearchResults, getShowDates, getStringArray, getStringsFromArrayToken, getStripNumbersFromAuditEventProperties, handleEventPostedForCustomAuditHistory, handleTimerExpiredForCustomAuditHistory, identifyAcl, identifyAcl, identifyApplicationToken, identifyAttribute, identifyAttributePropertyBundle, identifyAuditHandlerSpecification, identifyAuditSpecification, identifyAuditTargetSpecification, identifyAuditTypeList, identifyAuditTypeListBySpecification, identifyAutoFolderingActionSpecification, identifyByAttribute, identifyByPath, identifyByRelativePath, identifyCategory, identifyCategory, identifyClassAcl, identifyClassDomain, identifyClassObject, identifyClassPolicyBundle, identifyClassPropertyBundle, identifyCompositeGroup, identifyCustomLock, identifyCustomMediaDriverSpecification, identifyDependentView, identifyExtendedPermission, identifyFormat, identifyGlobalAuditSpecification, identifyGlobalAuditTypeList, identifyGroup, identifyGuestUser, identifyInstancePropertyBundle, identifyLibraryObject, identifyLifecycleDateRuleSpecification, identifyLifecyclePolicy, identifyLifecyclePolicyActionSpecification, identifyLifecyclePolicyEntry, identifyMedia, identifyMessageEntry, identifyMessageList, identifyNamedFreezeLock, identifyNamedPropertyBundle, identifyNodeConfiguration, identifyObjectAuditSpecification, identifyObjectProperty, identifyOperationActionSpecification, identifyPermissionBundle, identifyPolicy, identifyPolicyList, identifyPrimaryUserProfile, identifyPropertyBundle, identifyQueue, identifyQueueTypeMapBundle, identifyRetentionPolicy, identifyServerConfiguration, identifyServerSpecification, identifyServiceConfiguration, identifySingletonLockType, identifyStorageGroup, identifySystemAcl, identifySystemLockObject, identifySystemUser, identifyUser, identifyValueDefault, identifyValueDomain, identifyWorldGroup, impersonateUser, impersonateUser, initializeManualTextIndexingRetainedEvents, isBootstrapModeEnabled, isDomainScopeImpliedForSearch, isInArray, log, log, lookupAcl, lookupApplicationToken, lookupAuditDomainContext, lookupAuditSpecification, lookupAutoFolderingActionSpecification, lookupBusinessObject, lookupBusinessObjectHashtable, lookupBusinessObjectList, lookupClassAcl, lookupDatatype, lookupDatatypeString, lookupDefinition, lookupDefinition, lookupDirectoryObject, lookupDocument, lookupFolder, lookupFormat, lookupFormatFromCollection, lookupGroup, lookupMedia, lookupMessageEntry, lookupObject, lookupObject, lookupObjectAttributeValue, lookupObjectId, lookupOperationActionSpecification, lookupPublicObject, lookupQueue, lookupSessionByTag, lookupSystemAcl, lookupSystemLockObject, lookupTagBySessionId, lookupUser, lookupUserFromCollection, makeDefinitionReadOnly, markCurrentAuditingId, modifyClassObject, move, moveCategory, normalizeBooleanString, notifyCustomAuditHistoryHandler, objectExists, postCustomAuditEvent, postCustomAuditEvent, postCustomAuditEvent, postSystemAuditEvent, postSystemAuditEvent, preprocessDocumentSettings, preprocessPublicObjectSettings, printStackTrace, processManualTextIndexingRetainedEvents, processRawAuditEvents, purgeGlobalAuditHistory, reactivateUnknownOperationActionSpecifications, readDocumentContent, refreshDependentView, registerAllNonCustomAuditTypes, registerAuditEventType, registerAuditEventType, registerBusinessObject, registerCustomAuditType, registerCustomLockType, registerDefinition, registerLockType, registerNewSession, registerObject, registerTransaction, releaseLock, releaseManualLock, removeAcesForFreedGrantees, removeAllAttachments, removeAttachment, removeAttribute, removeClassProperty, removeCustomLockEntry, removeGroupMembers, removeNamedFreezeLock, removeProperties, removeServerFromNodeConfiguration, removeServiceFromNodeConfiguration, removeSession, removeSessionState, removeSingletonLock, removeTag, rename, replaceMediaLookupsByFormat, replaceSession, resetFolderCountInfo, restoreGlobalOperationActionSpecification, runSchemaCreator, runScript, saveGlobalOperationActionSpecification, saveSearchResultPrimaryObjects, saveSearchResults, searchAuditHistory, searchAuditHistory, searchAuditHistory, sessionExists, setAdminMode, setAdminMode, setArrayTokenDelimiter, setAuditingStartingId, setAuditSpecificationAuditHandlerSpecificationDefinition, setAuditSpecificationAuditTargetSpecificationDefinition, setAuditSpecificationAuditTypeListDefinition, setAuditTargetSpecificationDefinitionTarget, setBooleanInstanceProperty, setClassObjectCreationMode, setClassPolicyList, setClassProperty, setCreateCategoriesServerSideOption, setCurrentSession, setCurrentSession, setDateFormat, setDefaultAuditEventSortClause, setDefaultMedia, setDefaultScriptOperationsClass, setDefaultStorageGroup, setDefinitionAttribute, setDefinitionAttribute, setDefinitionBooleanAttribute, setDefinitionClassObjectAttribute, setDefinitionDateAttribute, setDefinitionDirectoryObjectArrayAttribute, setDefinitionDirectoryObjectAttribute, setDefinitionDoubleAttribute, setDefinitionIntegerAttribute, setDefinitionLongAttribute, setDefinitionNullStringAttribute, setDefinitionObjectAttribute, setDefinitionSchemaObjectArrayAttribute, setDefinitionSchemaObjectAttribute, setDefinitionStringArrayAttribute, setDefinitionStringAttribute, setDefinitionSystemObjectAttribute, setDocumentDefinitionContentObjectDefinition, setGlobalAuditTypeList, setGlobalOperationActionSpecifications, setInstallationMode, setInstallationMode, setInstanceProperty, setIntegerInstanceProperty, setLifecyclePolicyDefinitionDeleteEntriesOption, setLocale, setLongInstanceProperty, setLongSessionState, setMainSessionAsCurrentSession, setMediaLookupByFormat, setNumberFormat, setObjectProperty, setPreventSessionTimeouts, setPreventSessionTimeouts, setProperty, setPublicObjectInstanceProperty, setRepositoryParameter, setStringInstanceProperty, setStringSessionState, setSubstitutionPrefix, setSystemAdminMode, setSystemAdminMode, setSystemObjectInstanceProperty, setTimeoutPeriodOption, setTimeZone, setUserCreateOptions, setUserDefaultAcl, setUserDeleteOptions, showAcl, showAggregateAuditEventColumns, showAllAutoFolderingActionSpecifications, showAllClassAcls, showAllClassDomains, showAllClassObjects, showAllCustomAuditSpecifications, showAllCustomMediaDriverSpecifications, showAllDependentViews, showAllExtendedPermissions, showAllExternalRetentionPolicies, showAllFormats, showAllLifecycleDateRuleSpecifications, showAllLifecyclePolicies, showAllLifecyclePolicyActionSpecifications, showAllMedias, showAllNodeConfigurations, showAllNodeConfigurations, showAllOperationActionSpecifications, showAllPermissionBundles, showAllPolicies, showAllPolicyLists, showAllRepositoryParameters, showAllRetentionPolicies, showAllServerConfigurations, showAllServerConfigurations, showAllServerSpecifications, showAllServiceConfigurations, showAllServiceConfigurations, showAllStorageGroups, showAllSystemAcls, showAllValueDefaults, showAllValueDomains, showApplicationToken, showApplicationTokens, showAttachments, showAttribute, showAttribute, showAuditCertificates, showAuditEventOperationTypes, showAuditSpecification, showAuditTypeList, showAuditTypesForClass, showAuditTypesForCreateOperations, showAuditTypesForFreeOperations, showAuditTypesUnderClass, showAutoFolderingActionSpecification, showCapabilities, showClassDomain, showClassDomain, showClassObject, showClassObjectAndSubNames, showClassObjectAndSubs, showCompositeGroup, showCreateClassObjectScript, showCurrentUser, showCustomAuditHistory, showCustomAuditHistory, showCustomAuditTypes, showCustomMediaDriverSpecification, showDefaultMedia, showDefaultStorageGroup, showDefineAttributeScript, showDefinition, showDefinitionObject, showDependentView, showDocument, showDocumentCharacterSet, showDocumentContentInfo, showDocumentContents, showDocumentContents, showDocumentContents, showDocumentLanguage, showDocumentsWithLifecyclePolicy, showExpandedAuditTypeList, showExtendedPermission, showFolder, showFolder, showFolderCountInfo, showFormat, showGlobalAuditHistory, showGlobalAuditHistory, showGlobalAuditSpecification, showGlobalAuditTypeList, showGlobalOperationActionSpecifications, showGroup, showInstanceProperty, showInstancePropertyBundle, showLibraryObject, showLibraryObject, showLifecycleDateRuleSpecification, showLifecyclePolicy, showLifecyclePolicyActionSpecification, showLifecyclePolicyEntry, showLink, showLocalizer, showLockEntry, showLockEntryInfo, showLockTypeLookupTables, showMedia, showMediaLookupByFormatMappings, showMessageEntry, showMessageList, showNamedPropertyBundle, showNodeConfiguration, showNodeConfiguration, showObject, showObjectAuditHistory, showObjectAuditHistory, showObjectAuditSpecification, showOperationActionSpecification, showParsedArrayToken, showParsedOperationString, showPermissionBundle, showPolicy, showPolicyList, showPreparedSelector, showPreparedSelector, showProperty, showPropertyBundle, showRepositoryParameter, showRetentionPolicy, showRuntimeStatistics, showSavedSearchResultPrimaryObjects, showSavedSearchResults, showServerConfiguration, showServerConfiguration, showServerSpecification, showServiceConfiguration, showServiceConfiguration, showServiceStatistics, showSessionCacheStatistics, showSessionState, showSimplePropertyTable, showSimplePropertyTableList, showStorageGroup, showUser, showValueDefault, showValueDefault, showValueDomain, showValueDomain, sleep, syncContentIndex, syncIndex, testJsonString, tokenToDirectoryObjectArray, tokenToDirectoryUserArray, tokenToDocumentArray, transactionExists, unregisterAuditEventType, unregisterCustomAuditType, update, updateAccessControlList, updateClassDomain, updateDefinitionObject, updateLibraryObject, updateLibraryObject, updateLibraryObject, updateNodeConfiguration, updateNodeConfiguration, updateServerConfiguration, updateServerConfiguration, updateServiceConfiguration, updateServiceConfiguration, updateUserPassword, updateValueDefault, updateValueDomain, verifyBusinessObjectTagNotExists, verifyDefinitionTagNotExists, verifyDefinitionWriteable, verifyObjectTagNotExists, writeConsoleOutputString, writeConsoleOutputString, writeDocumentContentToFile, zeroPad
public UpgradeOperations(ScriptDriver driver)
driver
- the main script driver instancepublic void copyToExistingMapAttribute(AttributeValueTable avt) throws IfsException
The keys supported by this operation:
avt
- the named argumentsIfsException
- if the operation failspublic void copyToNewMapAttribute(AttributeValueTable avt) throws IfsException
defineAttribute
,
which will get added as a new Attribute as part of this operation.
The keys supported by this operation:
avt
- the named argumentsIfsException
- if the operation failspublic void addTableColumn(AttributeValueTable avt) throws IfsException
The keys supported by this operation:
avt
- the named argumentsIfsException
- if the operation failspublic void renameTableColumn(AttributeValueTable avt) throws IfsException
The keys supported by this operation:
avt
- the named argumentsIfsException
- if the operation failspublic void renameAttributeColumnName(AttributeValueTable avt) throws IfsException
The keys supported by this operation:
avt
- the named argumentsIfsException
- if the operation failsprotected void addColumnIfNecessary(IfsConnection conn, String tableName, String columnName, String rdbmsDataType) throws SQLException
conn
- database connectiontableName
- the table namecolumnName
- the name of the new column to addrdbmsDataType
- the DBMS data type string (e.g. "NUMBER(20)" )SQLException
- if the operation failsprotected void renameColumn(IfsConnection conn, String tableName, String columnName, String newColumnName) throws SQLException
conn
- database connectiontableName
- the table namecolumnName
- the name of the existing columnnewColumnName
- the new name for the columnSQLException
- if the operation failsprotected void renameAttributeDatabaseObjectName(IfsConnection conn, Long attrId, String newColumnName) throws SQLException
conn
- database connectionattrId
- the Attribute IDnewColumnName
- the new name for the DATABASEOBJECTNAMESQLException
- if the operation failsprotected void initializeColumns(IfsConnection conn, String tableName, String[] pkCols, int[] pkColTypes, String selCondition, String updColClause, int batchSize) throws SQLException
conn
- database connectiontableName
- the table namepkCols
- the primary key columns;
e.g. {"id"} or {"actorid", "recordid"}, etc.pkColTypes
- the data types of the primary key columns;
the first type must be Attribute.ATTRIBUTEDATATYPE_LONGselCondition
- the select condition; e.g. "NEWCOLa is null or NEWCOLb is null"updColClause
- the update clause list; e.g. "NEWCOLa = 0, NEWCOLb = 0"batchSize
- the maximum number of rows to select in each batchSQLException
- if the operation failsprotected List<Object[]> selectPrimaryKeyBatch(IfsConnection conn, long lastId, int batchSize, String tableName, String[] selCols, int[] selTypes, String selCondition, String pkOperator) throws SQLException
conn
- database connectionlastId
- the last Primary key processed, included in the query
to only process IDs greater (or equal) than this valuebatchSize
- the maximum number of rows to be selectedtableName
- the select target (table or view name)selCols
- the columns to select; the first must be the primary keyselTypes
- the data types of the columns selected, using the constants
defined in Attribute;
the first must be of type Attribute.ATTRIBUTEDATATYPE_LONGselCondition
- the select condition; e.g. "NEWCOLa is null or NEWCOLb is null"pkOperator
- the primary key's comparison operator;
use ">" or ">=", or null to indicate
the value is derived from the length of pkColsSQLException
- if the operation failsprotected Object getValueFromResultSet(ResultSet rset, int pos, int dataType) throws SQLException
rset
- the ResultSet to select frompos
- the column positiondataType
- the type of the column selected (Attribute data types)SQLException
- if the operation failsprotected void setValueInStatement(IfsPreparedStatement stmt, int dataType, Object value, int position) throws SQLException
stmt
- the statementdataType
- the data type of the valuevalue
- the valueposition
- the position in the statementSQLException
- if operation failsprotected void executeStatement(IfsConnection conn, String stmtString) throws SQLException
conn
- the database connectionstmtString
- the SQL to executeSQLException
- if the operation failsprotected int executeUpdate(IfsConnection conn, String stmtString) throws SQLException
Returns the number of rows affected by the update.
conn
- the database connectionstmtString
- the SQL to executeSQLException
- if the operation failsprotected String getColumnList(String[] cols)
cols
- the columnsprotected String getUpdateWhereClause(String[] cols)
Returns a String like: "COLX = ? and COLY = ? and COLZ = ?"
pkCols
- the column namesprotected String getUpdateSql(String tableName, String[] pkCols, String updateClause)
Returns a String like: UPDATE tablename x set NEWCOLa = 0, NEWCOLb = 0 where PKCOL1 = ? and PKCOL2 = ?
tableName
- the table namepkCols
- the primary key columnsupdColClause
- the update clause list; e.g. "NEWCOLa = 0, NEWCOLb = 0"protected void createTable(IfsConnection conn, String tableName, String createStmt) throws SQLException
conn
- the database connectiontableName
- the name of the tablecreateStmt
- the CREATE TABLE sql stringSQLException
- if the operation failsprotected void createTable(IfsConnection conn, String tableName, String createStmt, boolean dropFirst) throws SQLException
conn
- the database connectiontableName
- the name of the tablecreateStmt
- the CREATE TABLE sql stringdropFirst
- whether to attempt to drop the table firstSQLException
- if the operation failsprotected void createView(IfsConnection conn, String viewName, String createStmt) throws SQLException
conn
- the database connectionviewName
- the name of the viewcreateStmt
- the CREATE VIEW sql stringSQLException
- if the operation failsprotected void dropTable(IfsConnection conn, String tableName) throws SQLException
Does not throw an exception if the attempt fails.
conn
- the database connectiontableName
- the name of the tableSQLException
- if the operation failsprotected void dropView(IfsConnection conn, String viewName) throws SQLException
Does not throw an exception if the attempt fails.
conn
- the database connectionviewName
- the name of the tableSQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String columnName, boolean isUnique) throws SQLException
If the index name is in use, it will be dropped and the creation will be retried. If an equivalent index exists for the column specified, the specified index will not be created, and no exception will be thrown.
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumnName
- the name of the columnisUnique
- is the index to be a unique index?SQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String columnName, boolean isUnique, boolean dropAndRetryIfExists, boolean ignoreIfEquivalent) throws SQLException
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumnName
- the name of the columnisUnique
- is the index to be a unique index?dropAndRetryIfExists
- if index name exists, should it be
dropped and creation retried?ignoreIfEquivalent
- if another index exists on the
specified columns, should the
exception be ignored?SQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String columnName1, String columnName2, boolean isUnique) throws SQLException
If the index name is in use, it will be dropped and the creation will be retried. If an equivalent index exists for the columns specified, the specified index will not be created, and no exception will be thrown.
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumnName1
- the name of the first columncolumnName2
- the name of the second columnisUnique
- is the index to be a unique index?SQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String columnName1, String columnName2, boolean isUnique, boolean dropAndRetryIfExists, boolean ignoreIfEquivalent) throws SQLException
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumnName1
- the name of the first columncolumnName2
- the name of the second columnisUnique
- is the index to be a unique index?dropAndRetryIfExists
- if index name exists, should it be
dropped and creation retried?ignoreIfEquivalent
- if another index exists on the
specified columns, should the
exception be ignored?SQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String[] columns, boolean isUnique) throws SQLException
If the index name is in use, it will be dropped and the creation will be retried. If an equivalent index exists for the columns specified, the specified index will not be created, and no exception will be thrown.
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumns
- the names of the columnsisUnique
- is the index to be a unique index?SQLException
- if the operation failsprotected void createIndex(IfsConnection conn, String indexName, String tableName, String[] columns, boolean isUnique, boolean dropAndRetryIfExists, boolean ignoreIfEquivalent) throws SQLException
conn
- the database connectionindexName
- the name of the indextableName
- the name of the tablecolumns
- the names of the columnsisUnique
- is the index to be a unique index?dropAndRetryIfExists
- if index name exists, should it be
dropped and creation retried?ignoreIfEquivalent
- if another index exists on the
specified columns, should the
exception be ignored?SQLException
- if the operation failsprotected void dropIndex(IfsConnection conn, String indexName) throws SQLException
conn
- the database connectionindexName
- the name of the indexSQLException
- if the operation failsprotected void createSequence(IfsConnection conn, String seqName, int initialValue, int cacheSize) throws SQLException
Assumes a few defaults: INCREMENT BY 1 NOMAXVALUE NOCYCLE
conn
- the database connectionseqName
- the name of the seqeunceinitialValue
- the initial valuecacheSize
- the cache sizeSQLException
- if the operation failsprotected void createSequence(IfsConnection conn, String seqName, int initialValue, int cacheSize, boolean dropFirst) throws SQLException
Assumes a few defaults: INCREMENT BY 1 NOMAXVALUE NOCYCLE
conn
- the database connectionseqName
- the name of the seqeunceinitialValue
- the initial valuecacheSize
- the cache sizedropFirst
- whether to attempt to drop the seqeunce firstSQLException
- if the operation failsprotected void dropSequence(IfsConnection conn, String seqName) throws SQLException
conn
- the database connectionseqName
- the name of the seqeunceSQLException
- if the operation failsprotected long getNextSequenceValue(IfsConnection conn, String seqName) throws SQLException
Throws if the sequence does not exist.
conn
- the database connectionseqName
- the sequenceSQLException
- if the operation failsprotected boolean rowExists(IfsConnection conn, String tableName, String condition) throws SQLException
conn
- the database connectiontableName
- the table namecondition
- the where clauseSQLException
- if the operation failsprotected boolean rowExists(IfsConnection conn, String tableName, String condition, boolean errorValue)
conn
- the database connectiontableName
- the table namecondition
- the where clauseerrorValue
- the value to return if the SQL failsSQLException
- if the operation failsprotected boolean tableExists(IfsConnection conn, String tableName) throws SQLException
conn
- the database connectiontableName
- the table nameSQLException
- if the operation failsprotected boolean columnExists(IfsConnection conn, String tableName, String columnName) throws SQLException
conn
- the database connectiontableName
- the table namecolumnName
- the column nameSQLException
- if the operation failsprotected void analyze(IfsConnection conn, String schemaName) throws SQLException
conn
- the database connectionschemaName
- the name of the schema to analyzeSQLException
- if the operation failsprotected void analyzeTable(IfsConnection conn, String schemaName, String tableName) throws SQLException
conn
- the database connectionschemaName
- the name of the schema containing the tabletableName
- the name of the table to analyzeSQLException
- if the operation failsprotected void commit(IfsConnection conn) throws SQLException
conn
- the database connectionSQLException
- if the operation failsprotected void rollback(IfsConnection conn) throws SQLException
conn
- the database connectionSQLException
- if the operation failsprotected boolean isValidConnection(IfsConnection conn)
conn
- the database connectionprotected void closeResultSet(ResultSet rset)
rset
- the ResultSet to closeprotected void closeStatement(StatementWrapper stmt)
stmt
- the statement to closeCopyright © 2023. All rights reserved.