Interface ISQLWrapper

All Superinterfaces:
IPersistence, ISMBean
All Known Implementing Classes:
AbstractIndexedFile, AbstractORContainer, CachedSQLWrapper, CAIdealWrapper, CicsIndexedFile, CicsPersistence, Db400, Db400Container, Db400Sequential, DBMSWrapper, DMSWrapper, IDS2Wrapper, ImsDbSegment, LinkedSQLWrapper, QueueRecord, SQLWrapper, TSQueueStorageImpl

public interface ISQLWrapper extends IPersistence, ISMBean
Interface for Object-Relational classes talking to a database
  • Method Details

    • retrieveStatusValue

      int retrieveStatusValue()
    • retrieveNativeKeys

      ISMObject[] retrieveNativeKeys()
    • retrieveAdditionalSQLOrderBy

      StringBuilder retrieveAdditionalSQLOrderBy()
    • retrieveAdditionalSQLCondition

      StringBuilder retrieveAdditionalSQLCondition()
    • assignResultSet

      void assignResultSet(ResultSet resultSet)
    • retrieveResultSet

      ResultSet retrieveResultSet()
    • assignStatusValue

      void assignStatusValue(int newValue)
    • isKept

      boolean isKept()
    • setLock

      void setLock(boolean newValue)
    • unlock

      void unlock()
    • useOidTableForKeyGeneration

      boolean useOidTableForKeyGeneration()
    • assignDelegateDAO

      void assignDelegateDAO(ISQLWrapper delegateDAO)
    • retrieveDelegateDAO

      ISQLWrapper retrieveDelegateDAO()
    • retrieveConnection

      Connection retrieveConnection()
    • assignConnection

      void assignConnection(Connection connection)
    • assignFetchDirectionIsForward

      void assignFetchDirectionIsForward(Boolean direction)
    • isFetchDirectionForward

      boolean isFetchDirectionForward()
    • isFetchDirectionBackward

      boolean isFetchDirectionBackward()
    • validateConditionType

      int validateConditionType(ISMObject key, int conditionType)
      For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNED
      Parameters:
      conditionType -
      Returns:
    • retrieveImplicitDatabaseKey

      ISMObject retrieveImplicitDatabaseKey()
      for internal use only
      Returns:
    • assignRecordKey

      void assignRecordKey(ISMObject recordKey)
      Used only used by CicsPersistent Subclasses.
    • assignRecordKey

      void assignRecordKey(ISMObject[] recordKeys)
      Used only used by CicsPersistent Subclasses.
    • assignTreatAsSQLWrapper

      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.
    • close

      int close() throws IOCriticalException
      Throws:
      IOCriticalException
    • assignAdditionalSQLOrderBy

      void assignAdditionalSQLOrderBy(String newValue)
      This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g. (INDX_FLD_TABLE_1 ASCENDING)
      Parameters:
      condition -
    • assignSQLConditions

      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.
      e.g. assignSQLConditions("NAME = 'SMITH");
      (or when assignSQLConditions("NAME = ?") - the program should also use the "addSearchParameter" method to provide values
      Parameters:
      condition -
    • assignAdditionalSQLConditions

      void assignAdditionalSQLConditions(String condition)
      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 -
    • assignAdditionalSQLConditions

      void assignAdditionalSQLConditions(StringBuilder condition)
      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 -
    • retrieveAdditionalSearchParameters

      List<Object> retrieveAdditionalSearchParameters()
      assignSQLCondition can also have conditions such as "NAME = ?". In that case the program should also use the "addSearchParameter" method to provide values
      Returns:
    • assignTableName

      void assignTableName(String newName)
      Change the underlying SQL table-name FROM PROGRAMS
      Parameters:
      newName -
    • assignSQLTableName

      void assignSQLTableName(String newName)
      Change the underlying SQL table-name FROM persistent-Classes
      Parameters:
      newName -
    • retrieveTableName

      String retrieveTableName()
    • assignResultSetFetchSize

      void assignResultSetFetchSize(int newFetchSize)
    • next

      int next()
    • prev

      int prev()
    • read

      int read()
    • insert

      int insert()
    • delete

      int delete()
    • update

      int update()
    • retrieveAscentDescendOrder

      List<Boolean> retrieveAscentDescendOrder()
    • retrieveResultSetFetchSize

      int retrieveResultSetFetchSize()
    • isFileOpened

      boolean isFileOpened()
    • assignFileOpened

      void assignFileOpened(boolean fileOpened)
    • assignStatus

      void assignStatus(ISMObject status)
    • retrieveAccessMode

      int retrieveAccessMode()
    • assignAccessMode

      void assignAccessMode(int accessMode)
    • retrieveSessionId

      Long retrieveSessionId()
      Description copied from interface: ISMBean
      For internal use only
      Specified by:
      retrieveSessionId in interface ISMBean
    • retrieveRowFacade

      RowFacade retrieveRowFacade()
    • assignRowFacade

      void assignRowFacade(RowFacade rowFacade)
    • retrieveDbDecorator

      ACMDbDecorator retrieveDbDecorator()
    • assignDbDecorator

      void assignDbDecorator(ACMDbDecorator dbDecorator)
    • retrieveLastSeekCondition

      int retrieveLastSeekCondition()
    • assignLastSeekCondition

      void assignLastSeekCondition(int lastSeekCondition)
    • assignOpenMode

      void assignOpenMode(int openMode)
    • retrieveOpenMode

      int retrieveOpenMode()
    • isSequentialKeyGeneration

      boolean isSequentialKeyGeneration()
    • assignSequentialKeyGeneration

      void assignSequentialKeyGeneration(boolean sequentialKeyGeneration)
    • assignLastSeekConditionLookedForEquality

      void assignLastSeekConditionLookedForEquality(boolean newValue)
    • isLastSeekConditionLookedForEquality

      boolean isLastSeekConditionLookedForEquality()
    • isKeyUnique

      boolean isKeyUnique()
    • assignKeyIsUnique

      void assignKeyIsUnique(boolean keyUnique)
    • isSuppressNextReadCurrent

      boolean isSuppressNextReadCurrent()
    • retrieveFileName

      String retrieveFileName()
    • reduceGEorEQ

      void reduceGEorEQ(boolean newValue)
      used in AS400 / DB400 to increase speed of searches
    • isReduceGEorEQ

      boolean isReduceGEorEQ()
      used in AS400 / DB400 to increase speed of searches
    • isAllowedToExpandGTEQSearches

      boolean isAllowedToExpandGTEQSearches()
      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 >= ?)
      Parameters:
      newValue -
    • assignExpandGTEQSearches

      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 >= ?)
      Parameters:
      newValue -
    • assignLowerLimitForExpandGTEQSearches

      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 generated
       SELECT ... 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

      int retreiveLowerLimitForExpandGTEQSearches()
    • assignUpperLimitForExpandGTEQSearches

      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 generated
       SELECT ... 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 generated
       SELECT ... FROM ... WHERE 
          (A > ?) 

      and the following conditions will NOT be generated (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
    • retreiveUpperLimitForExpandGTEQSearches

      int retreiveUpperLimitForExpandGTEQSearches()
    • isChangeGEConditonToLIKE

      boolean isChangeGEConditonToLIKE()
      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 become
       SELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%' 
      This makes a significant performance improvements.
    • assignChangeGEConditonToLIKE

      void assignChangeGEConditonToLIKE(boolean newValue)
      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 become
       SELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%' 
      This makes a significant performance improvements.
    • isChangeGTEQ2EQForLIKECondition

      boolean isChangeGTEQ2EQForLIKECondition()
      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 become
       SELECT ... 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 become
       SELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%' 
      This can make a significant improvement to performance .
    • assignChangeGTEQ2EQForLIKECondition

      void assignChangeGTEQ2EQForLIKECondition(boolean useEQForExactLenghtMatch)
      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 become
       SELECT ... 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 become
       SELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%' 
      This can make a significant improvement to performance .
    • assignTopRowSelectStrategyCount

      void assignTopRowSelectStrategyCount(int count)
      (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

      int retrieveTopRowSelectStrategyCount()
      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

      int retrieveTopRowSelectStrategyStartingRow()
      for internal use only
    • assignTopRowSelectStrategyRange

      void assignTopRowSelectStrategyRange(int startRowNumber, int count)
      Similar to assignTopRowSelectStrategyCount - but aslso defines starting points
      Parameters:
      startRowNumber -
      count -
    • assignGenerate_OrderBy_ForReadStatements

      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. If the data was populated sequentially, then the ORDER BY may not be strictly required, and may be removed.
    • retrieveGenerate_OrderBy_ForReadStatements

      boolean retrieveGenerate_OrderBy_ForReadStatements()
      for internal use
      Parameters:
      newValue -
    • assignIgnoreOriginalKeys

      void assignIgnoreOriginalKeys(boolean newValue)
      for internal use
      Parameters:
      newValue -
    • isIgnoreOriginalKeys

      boolean isIgnoreOriginalKeys()
    • assignCachedSeekValues

      void assignCachedSeekValues(List objects)
    • retrieveCachedSeekValues

      List retrieveCachedSeekValues()
    • seekRecord

      int seekRecord(ISMObject key, int conditionType)
    • seekRecord

      int seekRecord(ISMObject[] keys, int conditionType) throws IOStatusException
      Throws:
      IOStatusException
    • assignGDGProperty

      void assignGDGProperty(String gdgProperty)
      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

      void assignGDGCondition(String gdgCondition)
      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.
    • assignKeyValue

      void assignKeyValue(AbstractDataObject key)
      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
      Parameters:
      value -
    • retrieveRecordKeyValue

      String retrieveRecordKeyValue()
      Used only used by CicsPersistent Subclasses.
      Parameters:
      value -
    • retrieveRecordKey

      ISMObject retrieveRecordKey()
    • retrieveThrowInvalidKeyException

      boolean retrieveThrowInvalidKeyException()
      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

      void assignThrowInvalidKeyException(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 ,
    • isSeekSuppressed

      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

      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 ,