Class ESQLBaseService

java.lang.Object
com.softwaremining.logic.BaseService
com.softwaremining.sql.ESQLBaseService
All Implemented Interfaces:
IBaseService, Service, SQLHandlerInterface, IDisplayable, Runnable
Direct Known Subclasses:
CicsBaseService, ILEBaseService, KeyGenerator

public class ESQLBaseService extends BaseService implements SQLHandlerInterface
Embedded-SQL BaseService - supporting business logic part of programs with Embedded-SQL
  • Field Details

    • staticLogger

      protected static Log staticLogger
    • totalRuntime

      public static long totalRuntime
      for internal use only ... profiling information
  • Constructor Details

    • ESQLBaseService

      public ESQLBaseService(BaseService parent)
    • ESQLBaseService

      public ESQLBaseService()
  • Method Details

    • setErrorHandler

      public void setErrorHandler(int errorHandler)
    • setErrorHandlerForward

      public void setErrorHandlerForward(String errorHandlerForward)
    • setNotFoundHandler

      public void setNotFoundHandler(int notFoundHandler)
    • setNotFoundHandlerForward

      public void setNotFoundHandlerForward(String notFoundHandlerForward)
    • setWarningHandler

      public void setWarningHandler(int warningHandler)
    • setErrorHandler

      public void setErrorHandler(int errorHandler, String errorHandlerForward)
    • setWarningHandler

      public void setWarningHandler(int warningHandler, String warningHandlerForward)
    • setNotFoundHandler

      public void setNotFoundHandler(int notFoundHandler, String notFoundHandlerForward)
      used for translation of SQL EXEC SQL WHENEVER NOT FOUND GO TO ...
      Parameters:
      notFoundHandler - - type : HANDLER_GO_TO , HANDLER_STOP , HANDLER_GO_TO = 2, HANDLER_THROW = 3
      notFoundHandlerForward - - method name. The framework applies a GO TO call startegy to the method. If the program is using standard java method calling strategy - the method is called and control is passed back .
    • processSQLException

      protected int processSQLException(SQLException e, ISMBean sqlca, int rowCount, boolean afterEndOfResultSet) throws CBLException
      used for internal SQL Handling
      Parameters:
      e -
      sqlca -
      notFound -
      Throws:
      CBLException
    • processSQLException

      public void processSQLException(SQLException e, int handler, String forward) throws CBLException
      Throws:
      CBLException
    • initializeBaseService

      public void initializeBaseService()
      in ESQL projects commits are manually made e.g EXEC SQL COMMIT END-EXEC Hence turn the auto-commit off during initialization
      Overrides:
      initializeBaseService in class BaseService
    • abort

      protected void abort(Throwable t)
      Rollback changes made by all instances of ESQLProcessor
      Overrides:
      abort in class BaseService
    • quit

      public void quit()
      Commit changes made by all instances of ESQLProcessor
      Overrides:
      quit in class BaseService
    • commit

      public void commit()
      Commit all the active ESQLProcessors
    • rollback

      public void rollback()
      Rollback ALL the active ESQLProcessors Only works when AUTO-COMMIT is switched off in db.properties. If autocommit is on, then use
        sqlprocessor.prepare("ROLLBACK");
              sqlprocessor.executeUpdate();
      ,
    • destroy

      protected void destroy()
      Close connection all instances of ESQLProcessor Automatically called after exiting a program (normal exit, Go-Back). and prepare for GC
      Overrides:
      destroy in class BaseService
    • destroyOnFatalError

      protected void destroyOnFatalError()
      Description copied from class: BaseService
      Automatically called after fatal error
      Overrides:
      destroyOnFatalError in class BaseService
    • releaseESQLConnections

      public void releaseESQLConnections()
      When the using connection strategy Config.CONNECTION_STRATEGY_SHARE_ESQL_SESSION_CONN the system will release Connections only when Garbage Collector releases the owning ESQLBaseService class. This method will force the connection to be closed
    • doFinalize

      public void doFinalize()
      Automatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperLists
      Overrides:
      doFinalize in class BaseService
    • doFinalize

      public void doFinalize(boolean forceRelease, boolean releaseConnection)
      Automatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperLists
      Overrides:
      doFinalize in class BaseService
      Parameters:
      forceRelease -
    • closeESQLProcessors

      protected void closeESQLProcessors(boolean releaseConnection)
      for internal use only
    • getESQLProcessors

      public ArrayList<ESQLProcessor> getESQLProcessors()
    • setSessionSchemaName

      public void setSessionSchemaName(String schemaName)
      Allows to dynamically change the SCHEMA_NAME (as defined in db.properties). The new SCHEMA_NAME only applies to the SQL access in current session.
      Parameters:
      schemaName -
    • resetSQLCA

      public static void resetSQLCA(ISMBean sqlca)
    • populateFromLastSQLMessage

      public void populateFromLastSQLMessage(ISMDataType _dfheiblk, ISMDataType _dfhcommarea, ISMDataType sqlca, ISMDataType messageArea, long length)
      Translation of CICS DSNTIAR
      Specified by:
      populateFromLastSQLMessage in interface IBaseService
      Overrides:
      populateFromLastSQLMessage in class BaseService
      Parameters:
      _dfheiblk - *UNUSED*
      _dfhcommarea - *UNUSED*
      sqlca -
      messageArea -
      length -
    • populateFromLastSQLMessage

      public void populateFromLastSQLMessage(ISMBean sqlca, ISMDataType messageArea, int length)
      Translation of CICS DSNTIAR
      Specified by:
      populateFromLastSQLMessage in interface IBaseService
      Overrides:
      populateFromLastSQLMessage in class BaseService
      Parameters:
      sqlca -
      messageArea -
      length -