Package com.softwaremining.sql
Class SQLWrapper
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
com.softwaremining.sql.AbstractIndexedFile
com.softwaremining.sql.SQLWrapper
- All Implemented Interfaces:
IPersistence
,ISQLWrapper
,AbstractDataObject
,ICBLBeanNGroup
,ICBLContainer
,IFieldContainer
,ISMBean
,ISMDataType
- Direct Known Subclasses:
CachedSQLWrapper
,CAIdealWrapper
,CicsPersistence
,Db400
,LinkedSQLWrapper
Abstract Object-Relational Container - USed for representation KSDS Indexed files.
COBOL Structures for accessing Indexed-File are be translated to an Object-Relational (OR) design
which read/write from a SQL Database instead of file system.
Such classes inherit from SQLWrapper or AbstractORContainer. The major part functionality for CRUD operations are provided in these classes.
Such classes inherit from SQLWrapper or AbstractORContainer. The major part functionality for CRUD operations are provided in these classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Connection
protected ISMObject[]
protected int
protected boolean
protected ResultSet
protected boolean
protected boolean
Fields inherited from class com.softwaremining.sql.AbstractIndexedFile
delegateDAO
Fields inherited from class com.softwaremining.wrappers.AbstractBasePersistence
fileName, ownerClassName, status
Fields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, log, tmp_lengthofAssignedValue, totalRuntime_allocate, totalRuntime_calcFieldOffsets, totalRuntime_getMemoryPosition, totalRuntime_setFieldFormatted
Fields inherited from interface com.softwaremining.sql.IPersistence
ACCESS_MODE_DYNAMIC, ACCESS_MODE_RANDOM, ACCESS_MODE_SEQUENTIAL, ASCENDING_RECORD_KEY, CONDITION_TYPE_EQUALS, CONDITION_TYPE_GREATER, CONDITION_TYPE_GREATER_OR_EQUALS, CONDITION_TYPE_IGNORE, CONDITION_TYPE_IGNORE_FOR_SQL_LIKE, CONDITION_TYPE_LESS, CONDITION_TYPE_LESS_OR_EQUALS, CONDITION_TYPE_LIKE, CONDITION_TYPE_NO_CONDITION, CONDITION_TYPE_NOT_ASSIGNED, DESCENDING_RECORD_KEY, OPEN_MODE_EXTEND, OPEN_MODE_I_O, OPEN_MODE_INPUT, OPEN_MODE_NOT_OPENED, OPEN_MODE_OUTPUT, STATUS_AT_END, STATUS_DUP_KEY, STATUS_FAILED_CLOSING, STATUS_INCORRECT_READ_OF_UNOPENED_FILE, STATUS_INCORRECT_RECORDSIZE_REWRITE, STATUS_INSERT_ERR_INAPPROPRIATE_FILE, STATUS_INSERT_ERR_INVALID_KEY, STATUS_LOCK, STATUS_NOT_FOUND, STATUS_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
_clear
(ISQLWrapper wrapper) int
_close
(ISQLWrapper wrapper) void
_commit
(ISQLWrapper wrapper) protected int
_deleteAllRecord
(ISQLWrapper wrapper) protected int
_deleteRecord
(ISQLWrapper wrapper) protected int
_insertRecord
(ISQLWrapper wrapper) int
_nextRecord
(ISQLWrapper wrapper) int
_open
(ISQLWrapper wrapper, int openMode) int
_prevRecord
(ISQLWrapper wrapper) int
_readRecord
(ISQLWrapper wrapper) int
_readWithLock
(ISQLWrapper wrapper) void
_rollback
(ISQLWrapper wrapper) protected int
_seekRecord
(ISMObject[] keys, int conditionType) void
_unlock
(ISQLWrapper wrapper) int
_updateRecord
(ISQLWrapper wrapper) void
addRecordKey
(ISMObject recordKey, Boolean ascendDescend) Allows adding single or composite record keys - one at a time invalid input: '&' specifying the Ascending/Descending ordervoid
addSearchParameter
(double theValue) void
addSearchParameter
(String theValue) void
assignAdditionalKeyPosition
(ISMObject theField, int position) Support for Tandem START ....void
assignAdditionalSQLConditions
(String condition) This method allows inserting additional conditions - e.g.void
assignAdditionalSQLConditions
(StringBuilder condition) Hierarchical tables will define additional SQLConditions - e.g.void
assignAdditionalSQLOrderBy
(String newValue) This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g.void
assignAlternateKey
(ISMObject alternateKey) void
assignCachedSeekValues
(List objects) for internal use onlyvoid
assignChangeGEConditonToLIKE
(boolean newValue) The system can replace GE searches to LIKE statements.void
assignChangeGTEQ2EQForLIKECondition
(boolean useEQForExactLenghtMatch) Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
E.g.void
assignConnection
(Connection connection) void
assignDbDecorator
(ACMDbDecorator dbDecorator) void
assignExpandGTEQSearches
(boolean expandGTEQSearches) (default is true) Example: Lets say there are 3 key fields involved in a search with condition GTEQ
If flag is set to true (default) - then the following SQL condition will be generated
(A > ? or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
With flag is set to FALSE - the following will be generated
(A >= ?) and (B >= ?) and (C >= ?)void
assignFetchDirectionIsForward
(Boolean direction) void
assignFetchSize
(int newFetchSize) maps onto ResultSet.setFetchSize Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this ResultSet object.void
assignFileOpened
(boolean fileOpened) void
assignGDGCondition
(String gdgProperty) Additional SQL statement to be read from gdg.properties file.void
assignGDGProperty
(String gdgProperty) Additional SQL statement to be read from gdg.properties file.void
assignGenerate_OrderBy_ForReadStatements
(boolean enabled) READ() statement on DB tables with MANY rows, issues an ORDER BY on the SELECT which may have a big performance impact.void
assignIgnoreOriginalKeys
(boolean newValue) for internal use onlyvoid
assignKeyIsUnique
(boolean keyUnique) used primarily in CICS Queues.void
assignKeyValue
(AbstractDataObject keyValueField) Used only used by CicsPersistent Subclasses.void
assignKeyValue
(String value) Deprecated.void
assignLastSeekCondition
(int lastSeekCondition) void
assignLastSeekConditionLookedForEquality
(boolean lastSeekConditionLookedForEquality) void
assignLowerLimitForExpandGTEQSearches
(int range) (default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
Example: Lets say there are 3 key fields involved in a search with condition GTEQ
In default settings, the following SQL condition will be generatedvoid
assignOpenMode
(int openMode) void
assignRecordKey
(ISMObject recordKey) Used only used by CicsPersistent Subclasses.void
assignRecordKey
(ISMObject[] recordKeys) Used only used by CicsPersistent Subclasses.void
record keys are descending (used in Db400 classes).void
assignRelativeKey
(AbstractCBLNumeric relativeKey) void
assignResultSet
(ResultSet resultSet) void
assignResultSetFetchSize
(int resultSetFetchSize) void
assignRowFacade
(RowFacade rowFacade) void
assignSequentialKeyGeneration
(boolean sequentialKeyGeneration) void
assignSQLConditions
(String condition)
Ignore the inbuilt KEY (defined by assignRecordKey(...)) - and use this condition instead
Please note program will be responsible for passing additional parameters.void
assignSQLTableName
(String newName) Called by "persistence" Classes themselves allows overriding the default table name.void
assignSuppressSeek
(boolean newValue) for internal use only - For VSAM SEEK / READ / ...void
assignTableName
(String newName) Deprecated.void
assignThrowInvalidKeyException
(boolean newValue) for internal use only - For VSAM SEEK / READ / ...void
assignTopRowSelectStrategyCount
(int count) (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:void
assignTopRowSelectStrategyRange
(int startRowNumber, int count) Similar to assignTopRowSelectStrategyCount - but aslso defines starting pointsvoid
assignTreatAsSQLWrapper
(boolean treatAsSQLWrapper) Used only used by CicsPersistent Subclasses.void
assignUpperLimitForExpandGTEQSearches
(int range) (default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
Example: Lets say there are 3 key fields involved in a search with condition GTEQ
In default settings, the following SQL condition will be generatedvoid
For internal use onlyboolean
internal use only.boolean
The system can replace GE searches to LIKE statements.boolean
For internal Use only.boolean
boolean
boolean
boolean
for internal use onlyboolean
isKept()
boolean
boolean
boolean
for internal use onlyboolean
for internal use only - For VSAM SEEK / READ / ...boolean
boolean
protected void
readCurrent
(boolean useNativeKeys) Used in DMS and ILE DAOvoid
reduceGEorEQ
(boolean newValue) used in AS400 / DB400 to increase speed of searchesvoid
this is called internally - after a program is CANCEL'ed.void
releaseResources
(boolean forceRelease) this is called internally - after a program is CANCEL'ed.void
protected void
restoreResultSet
(int conditionType, ISMObject[] searchKeys) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.int
int
assignSQLCondition can also have conditions such as "NAME = ?".Hierarchical tables will define additional SQLConditions - e.g.used internalfor internal use onlyprotected ISMObject[]
Stub method to be over-written by LinkedSQLWrapper class.boolean
for internal useNative Keys refer to either a.int
Native Keys refer to either a.int
for internal use onlyUsed only used by CicsPersistent Subclasses.int
boolean
for internal use only - For VSAM SEEK / READ / ...int
For internal use only (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:int
for internal use onlyvoid
setLock
(boolean kept) void
setRelativeKey
(AbstractCBLNumeric relativeKey) protected void
trimCachedSeekValues
(int numberOfFields) for internal use onlyboolean
Stub method to be over-written by LinkedSQLWrapper class.int
validateConditionType
(ISMObject key, int conditionType) For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNEDMethods inherited from class com.softwaremining.sql.AbstractIndexedFile
_assignKeyValue, assignAccessMode, assignDelegateDAO, assignStatus, clear, close, commit, delete, deleteAllRecord, deleteRecord, insert, insertRecord, next, nextRecord, open, prev, prevRecord, read, readRecord, readWithLock, resetCicsDelegate, retrieveDelegateDAO, rollback, seek, seek, seekRecord, seekRecord, seekRecord, unlock, update, updateRecord
Methods inherited from class com.softwaremining.wrappers.AbstractBasePersistence
assignFileName, assignLock, assignStatus, assignStatusAsPrimitive, assignStatusValue, assignStatusValue, readRow, retrieveAccessMode, retrieveFileName, retrieveFileName, retrieveFirstLevelEntry, retrieveSessionId, retrieveStatusField, retrieveStatusValue
Methods inherited from class com.softwaremining.wrappers.CBLBean
addCorrespondingValue, addCorrespondingValue, allocate, assignAddressTo, assignAddressTo, assignBean, assignBytesEncoded, assignCachedInitializationValue, assignCorrespondingValue, assignCorrespondingValue, assignDefaultValue, assignDependingField, assignEbcdicBytes, assignEbcdicJIT_PdSupportForSequentialFiles, assignEncodedValue, assignExemptFromMemRelease, assignExternal, assignHighValues, assignInternalVars, assignLowValues, assignRawEbcdicBytes, assignRecordSize, assignRedefines, assignRedefines, assignSessionId, assignStringFormatted, assignSubstring, assignSubstring, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAllFields, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, calculateStorageSize, containsPointers, equals, equals, equals, equals, equalsRightTrimmed, fieldsCount, fill, fill, fill, fill, fill, getValue, hasPackedDecimalFields, initDefaultValues, initialize, initialize, isExemptFromMemRelease, isFilled, isFilled, isFilled, isFilled, isGreaterThan, isGreaterThan, isGreaterThan, isHighValues, isInvolvedInDependency, isInvolvedInExternalDependency, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessThan, isLessThan, isLessThan, isLessThan, isLessThan, isLowValues, isRedefinedByAnotherClass, isResourceAlreadyReleased, lengthOf, printFieldPosition, printFieldValues, printOrderedFieldPosition, PrintOrderedFieldPositionsAndValue, resetCachedValues, resetCompressedFieldList, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveSQLObject, retrieveStorageCellSize, retrieveStorageChars, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.softwaremining.wrappers.ISMBean
assignExemptFromMemRelease, assignSessionId, assignValue, initialize, isExemptFromMemRelease, isResourceAlreadyReleased, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValue
Methods inherited from interface com.softwaremining.sql.ISQLWrapper
assignStatusValue, retrieveAccessMode, retrieveFileName, retrieveSessionId, retrieveStatusValue
-
Field Details
-
nativeKeys
-
connection
-
postFixTableNameToImplicitDatabaseKey
protected boolean postFixTableNameToImplicitDatabaseKey -
openMode
protected int openMode -
sequentialKeyGeneration
protected boolean sequentialKeyGeneration -
resultSet
-
suppressNextReadCurrent
protected boolean suppressNextReadCurrent
-
-
Constructor Details
-
SQLWrapper
public SQLWrapper()for internal use only ... profiling information -
SQLWrapper
-
-
Method Details
-
retrieveOpenMode
public int retrieveOpenMode()- Specified by:
retrieveOpenMode
in interfaceISQLWrapper
- Specified by:
retrieveOpenMode
in classAbstractBasePersistence
-
assignRecordKey
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses. -
assignRecordKey
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses. -
addRecordKey
Allows adding single or composite record keys - one at a time invalid input: '&' specifying the Ascending/Descending order- Parameters:
recordKey
- - ACMOBjectascendDescend
- - IPersistence.DESCENDING or IPersistence.ASCENDING
-
retrieveAscentDescendOrder
used internal- Returns:
-
assignRecordKeysAllDescending
public void assignRecordKeysAllDescending()record keys are descending (used in Db400 classes).- Parameters:
keyDescending
-
-
assignAlternateKey
-
setRelativeKey
-
assignRelativeKey
-
resetRowFacade
public void resetRowFacade() -
retrieveRowFacade
-
retrieveNativeKeys
Native Keys refer to either a. any keys set by setRecordKey b. in absence of any keys defined by setRecordKey, then an additional index keys is created by SoftwareMining framework. (This is usually called INDX_FLD_0;)- Returns:
-
retrieveImplicitDatabaseKey
Native Keys refer to either a. any keys set by setRecordKey b. in absence of any keys defined by setRecordKey, then an additional index keys is created by SoftwareMining framework. (This is usually called INDX_FLD_0;)- Returns:
-
_seekRecord
- Specified by:
_seekRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
restoreResultSet
translation of COBOL START The method will open a result-set, read the information and then Close the result-set.- Parameters:
conditionType
-keys
-- Throws:
IOStatusException
- public int seek(ACMField[] keys, int conditionType) { try { return seekRecord(keys, conditionType); } catch (IOStatusException e) { } return this.getStatusValue(); }SQLException
-
_commit
- Specified by:
_commit
in classAbstractIndexedFile
- Throws:
IOCriticalException
-
_rollback
- Specified by:
_rollback
in classAbstractIndexedFile
- Throws:
IOCriticalException
-
_nextRecord
- Specified by:
_nextRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_prevRecord
- Specified by:
_prevRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_readRecord
- Specified by:
_readRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_readWithLock
- Specified by:
_readWithLock
in classAbstractIndexedFile
-
_unlock
- Specified by:
_unlock
in classAbstractIndexedFile
-
_open
- Specified by:
_open
in classAbstractIndexedFile
- Throws:
IOCriticalException
-
_close
- Specified by:
_close
in classAbstractIndexedFile
- Throws:
IOCriticalException
-
_deleteRecord
- Specified by:
_deleteRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_deleteAllRecord
- Specified by:
_deleteAllRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_clear
- Specified by:
_clear
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_insertRecord
- Specified by:
_insertRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
_updateRecord
- Specified by:
_updateRecord
in classAbstractIndexedFile
- Throws:
IOStatusException
-
readCurrent
Used in DMS and ILE DAO- Parameters:
useNativeKeys
-- Throws:
IOStatusException
-
retrieveDbDecorator
-
isKeyUnique
public boolean isKeyUnique() -
assignKeyIsUnique
public void assignKeyIsUnique(boolean keyUnique) used primarily in CICS Queues.- Parameters:
keyUnique
-
-
retrieveAdditionalSQLOrderBy
-
assignAdditionalSQLOrderBy
Description copied from interface:ISQLWrapper
This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g. (INDX_FLD_TABLE_1 ASCENDING) -
retrieveAdditionalSQLCondition
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Returns:
-
assignAdditionalSQLConditions
Description copied from interface:ISQLWrapper
This method allows inserting additional conditions - e.g. assignAdditionalSQLConditions( "(COLUMN_2 = 12)"); It is useful in hierarchical tables will define additional SQLConditions - e.g. (INDX_FLD_TABLE_1 = 12), as well as GDG support- Parameters:
condition
-
-
assignSQLConditions
Description copied from interface:ISQLWrapper
Ignore the inbuilt KEY (defined by assignRecordKey(...)) - and use this condition instead
Please note program will be responsible for passing additional parameters.
e.g. assignSQLConditions("NAME = 'SMITH");
(or when assignSQLConditions("NAME = ?") - the program should also use the "addSearchParameter" method to provide values- Parameters:
condition
-
-
assignAdditionalSQLConditions
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Parameters:
condition
-
-
retrieveAdditionalSearchParameters
Description copied from interface:ISQLWrapper
assignSQLCondition can also have conditions such as "NAME = ?". In that case the program should also use the "addSearchParameter" method to provide values- Returns:
-
createAndretrieveSearchParameterInstance
For internal use only- Returns:
-
addSearchParameter
-
addSearchParameter
public void addSearchParameter(double theValue) -
clearSearchParameter
public void clearSearchParameter() -
assignFetchSize
public void assignFetchSize(int newFetchSize) maps onto ResultSet.setFetchSize Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this ResultSet object. If the fetch size specified is zero, the JDBC driver ignores the value and is free to make its own best guess as to what the fetch size should be. The default value is set by the Statement object that created the result set. The fetch size may be changed at any time, -
retrieveForeignKeys
Stub method to be over-written by LinkedSQLWrapper class.- Returns:
-
useOidTableForKeyGeneration
public boolean useOidTableForKeyGeneration()Stub method to be over-written by LinkedSQLWrapper class.- Returns:
-
releaseResources
public void releaseResources()this is called internally - after a program is CANCEL'ed. it is to help with the GC process- Overrides:
releaseResources
in classCBLBean
-
releaseResources
public void releaseResources(boolean forceRelease) this is called internally - after a program is CANCEL'ed. it is to help with the GC process- Specified by:
releaseResources
in interfaceISMBean
- Overrides:
releaseResources
in classCBLBean
- Parameters:
forceRelease
-
-
assignAdditionalKeyPosition
Support for Tandem START .... AFTER POSITON ...- Parameters:
theField
-position
-
-
isSequentialKeyGeneration
public boolean isSequentialKeyGeneration() -
assignSequentialKeyGeneration
public void assignSequentialKeyGeneration(boolean sequentialKeyGeneration) -
retrieveResultSet
-
assignResultSet
-
isKept
public boolean isKept() -
setLock
public void setLock(boolean kept) -
isFileOpened
public boolean isFileOpened() -
assignFileOpened
public void assignFileOpened(boolean fileOpened) -
retrieveLastSeekCondition
public int retrieveLastSeekCondition() -
assignLastSeekCondition
public void assignLastSeekCondition(int lastSeekCondition) -
isSuppressNextReadCurrent
public boolean isSuppressNextReadCurrent() -
isLastSeekConditionLookedForEquality
public boolean isLastSeekConditionLookedForEquality() -
assignLastSeekConditionLookedForEquality
public void assignLastSeekConditionLookedForEquality(boolean lastSeekConditionLookedForEquality) -
retrieveResultSetFetchSize
public int retrieveResultSetFetchSize() -
assignResultSetFetchSize
public void assignResultSetFetchSize(int resultSetFetchSize) -
assignRowFacade
-
assignDbDecorator
-
assignOpenMode
public void assignOpenMode(int openMode) -
assignTableName
Deprecated.Called Programs declaring instances of the persistence classes
FOr Indexed-Files, this call often relates to setting name to a data-file name E.g. for
SELECT CUSTOMER-FILE assign to "CUSTOMER.DAT"
Results in:
customerFile.assignTableName("customer.dat");
or
customerFile.assignTableName(System.getEnv("CUST");
this is incorrect. We cannot keep changing the table names.
But we cannot suppress its generation - as the system should be able to swap between IndexedFiles and SQLWrappe/OR . IndexedFiles WILL need this. Besides, this may "sometimes" be useful. So, the system is going to continue generating the call to this method.
However, the real name can be set by the persistence class itself - using "assignSQLTableName"- Specified by:
assignTableName
in interfaceISQLWrapper
- Overrides:
assignTableName
in classAbstractBasePersistence
- Parameters:
newName
-
-
assignSQLTableName
Called by "persistence" Classes themselves allows overriding the default table name. This sets the table to the matching one in SQL DDL The main Program classes still call "assignTableName" - which would do nothing. The call is not currently removed for safety - It may become needed at some stage for some projects- Parameters:
newName
-
-
retrieveTableName
-
assignKeyValue
Deprecated.- Parameters:
value
-
-
assignKeyValue
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses. After each read or next, it will update the value of the Key with the new values from database -
retrieveRecordKey
for internal use only- Returns:
-
retrieveRecordKeyValue
Used only used by CicsPersistent Subclasses.- Parameters:
value
-
-
assignTreatAsSQLWrapper
public void assignTreatAsSQLWrapper(boolean treatAsSQLWrapper) Used only used by CicsPersistent Subclasses. allows CicsPersistent (ILE or other subclasses of this) to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.- Parameters:
value
-
-
reduceGEorEQ
public void reduceGEorEQ(boolean newValue) Description copied from interface:ISQLWrapper
used in AS400 / DB400 to increase speed of searches -
isReduceGEorEQ
public boolean isReduceGEorEQ()for internal use only -
assignIgnoreOriginalKeys
public void assignIgnoreOriginalKeys(boolean newValue) for internal use only- Parameters:
newValue
-
-
isIgnoreOriginalKeys
public boolean isIgnoreOriginalKeys()for internal use only -
isAllowedToExpandGTEQSearches
public boolean isAllowedToExpandGTEQSearches()Description copied from interface:ISQLWrapper
internal use only. Example: Lets say there are 3 key fields involved in a search with condition GTEQ
If flag is set to true (default) - then the following SQL condition will be generated
(A > ? or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
With flag is set to FALSE - the following will be generated
(A >= ?) and (B >= ?) and (C >= ?) -
assignExpandGTEQSearches
public void assignExpandGTEQSearches(boolean expandGTEQSearches) Description copied from interface:ISQLWrapper
(default is true) Example: Lets say there are 3 key fields involved in a search with condition GTEQ
If flag is set to true (default) - then the following SQL condition will be generated
(A > ? or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
With flag is set to FALSE - the following will be generated
(A >= ?) and (B >= ?) and (C >= ?) -
isChangeGEConditonToLIKE
public boolean isChangeGEConditonToLIKE()Description copied from interface:ISQLWrapper
The system can replace GE searches to LIKE statements. this can potentially have a huge performance improvement.
E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
If each key is 5 chars, and the supplied values are "A " and "B " - the above translates to:SELECT ... from TABLE WHERE KEY_1 >= 'A ' AND KEY_2 >= 'B '.
Converting it to LIKE will becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements. -
assignChangeGEConditonToLIKE
public void assignChangeGEConditonToLIKE(boolean newValue) Description copied from interface:ISQLWrapper
The system can replace GE searches to LIKE statements. this can potentially have a huge performance improvement.
E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
If each key is 5 chars, and the supplied values are "A " and "B " - the above translates to:SELECT ... from TABLE WHERE KEY_1 >= 'A ' AND KEY_2 >= 'B '.
Converting it to LIKE will becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements. -
isChangeGTEQ2EQForLIKECondition
public boolean isChangeGTEQ2EQForLIKECondition()Description copied from interface:ISQLWrapper
For internal Use only.
Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
If each key is 5 chars, and the supplied values are "ABCDE" and "B " - the above translates to:SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 >= 'B '.
Converting it to LIKE will becomeSELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 LIKE 'B%'
When this flag is set, if the char-count of a field is equal to that of the supplied value, then the generated SQL will becomeSELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%'
This can make a significant improvement to performance . -
assignChangeGTEQ2EQForLIKECondition
public void assignChangeGTEQ2EQForLIKECondition(boolean useEQForExactLenghtMatch) Description copied from interface:ISQLWrapper
Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
If each key is 5 chars, and the supplied values are "ABCDE" and "B " - the above translates to:SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 >= 'B '.
Converting it to LIKE will becomeSELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 LIKE 'B%'
When this flag is set, if the char-count of a field is equal to that of the supplied value, then the generated SQL will becomeSELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%'
This can make a significant improvement to performance . -
isSeekSuppressed
public boolean isSeekSuppressed()for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException ,- Returns:
-
assignSuppressSeek
public void assignSuppressSeek(boolean newValue) for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException , -
assignTopRowSelectStrategyCount
public void assignTopRowSelectStrategyCount(int count) Description copied from interface:ISQLWrapper
(Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:SELECT � FROM table WHERE condition-1
When set to greater than 1 - (for Oracle) it will produce:SELECT ... FROM ( SELECT � FROM table WHERE condition-1 ) WHERE ROWNUM <OR_SELECT_TOP_ROW__DEFAULT;
-
retrieveTopRowSelectStrategyCount
public int retrieveTopRowSelectStrategyCount()Description copied from interface:ISQLWrapper
For internal use only (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:SELECT ... FROM table WHERE condition-1
When set to greater than 1 - (for Oracle) it will produce:SELECT ... FROM ( SELECT ... FROM table WHERE condition-1 ) WHERE ROWNUM <OR_SELECT_TOP_ROW__DEFAULT;
-
retrieveTopRowSelectStrategyStartingRow
public int retrieveTopRowSelectStrategyStartingRow()Description copied from interface:ISQLWrapper
for internal use only -
assignTopRowSelectStrategyRange
public void assignTopRowSelectStrategyRange(int startRowNumber, int count) Description copied from interface:ISQLWrapper
Similar to assignTopRowSelectStrategyCount - but aslso defines starting points- Parameters:
startRowNumber
-count
-
-
retrieveGenerate_OrderBy_ForReadStatements
public boolean retrieveGenerate_OrderBy_ForReadStatements()Description copied from interface:ISQLWrapper
for internal use -
assignGenerate_OrderBy_ForReadStatements
public void assignGenerate_OrderBy_ForReadStatements(boolean enabled) Description copied from interface:ISQLWrapper
READ() statement on DB tables with MANY rows, issues an ORDER BY on the SELECT which may have a big performance impact. If the data was populated sequentially, then the ORDER BY may not be strictly required, and may be removed. -
assignCachedSeekValues
for internal use only -
retrieveCachedSeekValues
for internal use only -
trimCachedSeekValues
protected void trimCachedSeekValues(int numberOfFields) for internal use only -
assignGDGProperty
Additional SQL statement to be read from gdg.properties file. E.g. assignGDGProperty("GDG1"); If gdg.properties file contains: GDG1=AND GDG_YEAR=2012 Then the above search condition will be appended to any SQL statements issued reading this class -
assignGDGCondition
Additional SQL statement to be read from gdg.properties file. E.g. assignGDGCondition("GDG_YEAR = 2013"); Then the above search condition will be appended to any SQL statements issued reading this class. -
validateConditionType
For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNED- Parameters:
conditionType
-- Returns:
-
retrieveThrowInvalidKeyException
public boolean retrieveThrowInvalidKeyException()Description copied from interface:ISQLWrapper
for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException ,- Returns:
-
assignThrowInvalidKeyException
public void assignThrowInvalidKeyException(boolean newValue) Description copied from interface:ISQLWrapper
for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException , -
assignLowerLimitForExpandGTEQSearches
public void assignLowerLimitForExpandGTEQSearches(int range) Description copied from interface:ISQLWrapper
(default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
Example: Lets say there are 3 key fields involved in a search with condition GTEQ
In default settings, the following SQL condition will be generatedSELECT ... FROM ... WHERE (A > ?) or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
using the statement assignLowerLimitForExpandGTEQSearches( 3 ) - the key conditions below position 3 are ignored, and only the following is generated.SELECT ... FROM ... WHERE (A = ? and B = ? and C >= ?))
and the following proceeding conditions are ignored invalid input: '<'> (A > ?)
or (A = ? and B > ?) -
retreiveLowerLimitForExpandGTEQSearches
public int retreiveLowerLimitForExpandGTEQSearches() -
assignUpperLimitForExpandGTEQSearches
public void assignUpperLimitForExpandGTEQSearches(int range) Description copied from interface:ISQLWrapper
(default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
Example: Lets say there are 3 key fields involved in a search with condition GTEQ
In default settings, the following SQL condition will be generatedSELECT ... FROM ... WHERE (A > ?) or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
but if assignUpperLimitForExpandGTEQSearches( 1 ) - only conditions up to 1st Key will be generated
ie The following will be generatedSELECT ... FROM ... WHERE (A > ?)
and the following conditions will NOT be generated (A = ? and B > ?) or (A = ? and B = ? and C >= ?)) -
retreiveUpperLimitForExpandGTEQSearches
public int retreiveUpperLimitForExpandGTEQSearches() -
assignConnection
-
retrieveConnection
-
assignFetchDirectionIsForward
-
isFetchDirectionForward
public boolean isFetchDirectionForward() -
isFetchDirectionBackward
public boolean isFetchDirectionBackward()
-