Class ESQLProcessor

java.lang.Object
com.softwaremining.sql.ESQLProcessor
All Implemented Interfaces:
SQLHandlerInterface
Direct Known Subclasses:
SPProcessor

public class ESQLProcessor extends Object implements SQLHandlerInterface
This class provides emulation of COBOL's EXEC SQL statement and cursor operations.
Each COBOL CURSOR will be translated to an instance of ESQLProcessor.
When using this class, the framework will be responsible for validating credentials, establishing and pooling database connections.
please see ESQLProcessor documentation and configuration via "db.properties" file. Typical usage pattern:
  sqlProcessor.prepare("SELECT name FROM customer-table WHERE id > ?");
  // Bind output variables for embedded sql 
  sqlProcessor.setInParameter(1, iData.getId());
  sqlProcessor.setOutParameter(1, iData.getFieldName());
  sqlProcessor.executeQuery();   // or sqlProcessor.openCursor() 
  while (sqlProcessor.next()( {
    System.out.println( idata.getName() );
  }
  
or
  sqlProcessor.prepare("INSERT INTO customer-table VALUES ( ? , ? )");
  // Bind output variables for embedded sql 
  sqlProcessor.setInParameter(1, iData.getId());
  sqlProcessor.setInParameter(2, iData.getName());
  sqlProcessor.executeUpdate();
  
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected static Log
     
     
    static long
    for internal use only ...
    static long
     
    protected Connection
    Connection to the database
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    constructor -
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    assignOutParameter(ISMObject outParameter, Object rsData)
    transfer a value from ResultSet to the ACMObject
    void
    clear the previously assigned output-parameters, allowing new output-parameters to be assigned.
    int
    CLose underlying resultset
    void
    This method uses the commit method on java.sql.Connection.
    protected void
    createPreparedStatement(String sql, boolean isForUpdate)
     
    void
    delete the current row
    int
    Execute SQL Query.
    int
    Execute SQL Query.
    int
    Not used by translator.
    int
    do fetch 'next' in the underlying resultset with SQL return codes
    void
    When auto-commit is not used, this method will force a connection.commit() - whether the system is using BATCH processing or not.
    void
    When auto-commit is not used, this method will force a connection.rollback() - whether the system is using BATCH processing or not.
    protected String
    formatSQL(String theSql)
    This method is intended to be overridden.
    get connection from connectionFactory
    get URI to db.properties file.
    protected ESQLBaseService
     
     
     
    int
     
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    int
    do 'next' in the underlying resultset
    boolean
    do 'next' in the underlying resultset
    int
    Execute SQL Query.
    void
    prepare the underlying 'statement' or 'preparedStatement'
    void
    prepare(String sql, boolean isForUpdate)
    prepare the underlying 'statement' or 'preparedStatement'
    protected void
    prepare the underlying 'statement' or 'preparedStatement'
    void
    Allows externalization of SQL scripts.
    void
    prepareSQLFromFile(String fileName, boolean isForUpdate)
    Allows externalization of SQL scripts.
    protected int
    processSQLException(SQLException e, ISMBean sqlca, boolean afterEndOfResultset)
    Sets the appropriate values on SQLCA
    protected int
    processSQLException(SQLException e, ISMBean sqlca, int theRowCount)
    Sets the appropriate values on SQLCA
    void
    CloseConnection is used internally on destroy of the application
    void
    releaseResources(boolean releaseConnection)
    close connection, and set owning ESQLBaseService to Null - for improved GC
    protected void
    Assign appropriate (normal return) values to SQLCA
    void
    rollback the sql
    Only works when AUTO-COMMIT is switched off in db.properties.
    void
    setBatchSize(int batchSize)
    setting a batch size of greater than one will cause the method executeUpdate to
    preparedStatement.addBatch()
    instead of
    preparedStatement.executeUpdate()
    void
    setClearOutParametersOnGet(boolean newValue)
    By-default, the system will NOT clear the OutputParameters after a executeQuery/OpenCursor/Fetch/Next This method allows the developers to override the functionality -
    void
     
    void
    setDbPropertiesURI(String dbPropertiesURI)
     
    void
    setFetchSize(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
    setInParameter(int position, byte[] value)
    Set input parameters for prepared query
    void
    setInParameter(int position, double value)
    Set input parameters for prepared query
    void
    setInParameter(int position, double newValue, int nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, int value)
    Set input parameters for prepared query
    void
    setInParameter(int position, long value)
    Set input parameters for prepared query
    void
    setInParameter(int position, CBLBean valueHolder)
     
    void
    setInParameter(int position, ISMBean valueHolder, ISMInteger nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, ISMDataType valueHolder)
    Set input parameters for prepared SQL query containing INSERT/UPDATE
    void
    setInParameter(int position, ISMObject valueHolder, ISMInteger nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, String value)
    Set input parameters for prepared query
    void
    setInParameter(int position, String value, int nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, String value, ISMInteger nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, BigDecimal value)
    Set input parameters for prepared query
    void
    setInParameter(int position, BigDecimal newValue, int nullIndicator)
    Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator.
    void
    setInParameter(int position, Date value)
    Set input parameters for prepared query
    void
    setInParameterOn49Group(int position, ISMGroup group)
    Special case for set input parameters for prepared query For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    void
    setInParameterOn49Group(int position, ISMGroup group, ISMInteger nullIndicator)
    Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setInParameterOn49Group(int position, ISMGroup valueHolder)
    void
    setOutParameter(int position, CBLBean wrapper)
    Bind output input parameters for prepared query
    void
    setOutParameter(int position, ISMDataType valueHolder)
    Bind output input parameters for prepared query
    void
    setOutParameter(int position, ISMDataType valueHolder, ISMDataType nullIndicator)
    Bind output input parameters for prepared query
    void
    setOutParameterOn49Group(int position, CBLBean wrapper)
    Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    void
    setOutParameterOn49Group(int position, ISMBean bean, ISMObject nullIndicator)
    Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    void
    setOutParameterOn49Group(int position, ISMGroup valueHolder)
    Special case for set Output parameters for prepared query DB2 VARCHAR's can be declared in COBOL as a field, or as group items containing only two elementary items, both of which must have a level number of 49.
    void
    setOutParameterOn49Group(int position, ISMGroup valueHolder, ISMObject nullIndicator)
    Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    void
    Associated return values with the SQLCA file.
    void
    Deprecated.
    void
    updateColumnValue(int columnIndex, double value)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, int value)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, long value)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, ISMDouble valueObj)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do cursor.updateColumnValue(1, newValue);
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, ISMGroup theContainer)
     
    void
    updateColumnValue(int columnIndex, ISMInteger valueObj)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, ISMLong valueObj)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, ISMString valueObj)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    updateColumnValue(int columnIndex, String value)
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated
    void
    Used in db2's SELECT col1 From table FOR UPDATE
    first the system will do cursor.executeQuery()
    later it can do
    cursor.updateColumnValue(1, newValue);
    cursor.updateRow();
    in this example, the value of "col1" will be updated

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • userDefinedConnection

      protected Connection userDefinedConnection
      Connection to the database
    • preparedStatement

      protected PreparedStatement preparedStatement
    • lastQuery

      protected String lastQuery
    • logger

      protected static Log logger
    • totalRuntime

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

      public static long totalRuntime_prepareFromFile
  • Constructor Details

    • ESQLProcessor

      public ESQLProcessor(ESQLBaseService owner)
      Constructor
      Parameters:
      owner -
    • ESQLProcessor

      public ESQLProcessor(ESQLBaseService owner, ISMBean sqlca)
      constructor -
      Parameters:
      owner -
      sqlca -
  • Method Details

    • setSQLCA

      public void setSQLCA(ISMBean sqlca)
      Associated return values with the SQLCA file.
      Parameters:
      sqlca -
    • prepare

      public void prepare(String sql) throws CBLException
      prepare the underlying 'statement' or 'preparedStatement'
      Parameters:
      sql -
      Throws:
      CBLException
    • prepare

      public void prepare(String sql, boolean isForUpdate) throws CBLException
      prepare the underlying 'statement' or 'preparedStatement'
      Parameters:
      sql -
      isForUpdate - : true when used for SELECT ... FOR UPDATE OF Cursor-name
      Throws:
      CBLException
    • prepareHelper

      protected void prepareHelper(String sql) throws CBLException
      prepare the underlying 'statement' or 'preparedStatement'
      Parameters:
      sql -
      isForUpdate - : true when used for SELECT ... FOR UPDATE OF Cursor-name
      Throws:
      CBLException
    • setWithHold

      @Deprecated public void setWithHold()
      Deprecated.
      this methods does nothing - it merely serves as a marker to notify developers they need to manually look after a SQL statement containing WITH HOLD . The Connection will need to be opened with HOLD_CURSORS_OVER_COMMIT as defined in: https://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/java/src/tpc/imjcc_cjvrschr.html
    • createPreparedStatement

      protected void createPreparedStatement(String sql, boolean isForUpdate) throws SQLException
      Throws:
      SQLException
    • assignOutParameter

      protected void assignOutParameter(ISMObject outParameter, Object rsData)
      transfer a value from ResultSet to the ACMObject
      Parameters:
      outParameter -
      rsData -
    • openCursor

      public int openCursor() throws CBLException
      Execute SQL Query. (used for "Select Statement" or for OPENing CURSORS ).
      Throws:
      CBLException
    • executeQuery

      public int executeQuery() throws CBLException
      Execute SQL Query. (used for "Select Statement" or for OPENing CURSORS ).
      Throws:
      CBLException
    • executeUpdate

      public int executeUpdate() throws CBLException
      Execute SQL Query. (used for Insert/Update/Any DML Statement).
      Throws:
      CBLException
    • setBatchSize

      public void setBatchSize(int batchSize)
      setting a batch size of greater than one will cause the method executeUpdate to
      preparedStatement.addBatch()
      instead of
      preparedStatement.executeUpdate()
    • executeUpdateThrowingSQLExpeption

      public int executeUpdateThrowingSQLExpeption() throws SQLException
      Not used by translator. This method is to allow manual override in business-logic code, to capture any SQLExceptions thrown
      Returns:
      rowCount
      Throws:
      SQLException
    • next

      public int next() throws CBLException
      do 'next' in the underlying resultset
      Returns:
      ORIG_DB_NORMAL_RETURN (SQLCodesDB2.NORMAL_RETURN) if another record found, other Codes from SQLCodesDB2 if no more records in the
      Throws:
      CBLException
    • nextRow

      public boolean nextRow() throws CBLException
      do 'next' in the underlying resultset
      Returns:
      true if another record found, false if no more records in the
      Throws:
      CBLException
    • fetch

      public int fetch() throws CBLException
      do fetch 'next' in the underlying resultset with SQL return codes
      Returns:
      ORIG_DB_NORMAL_RETURN (SQLCodesDB2.NORMAL_RETURN) if another record found, other Codes from SQLCodesDB2 if no more records in the
      Throws:
      CBLException
    • close

      public int close() throws CBLException
      CLose underlying resultset
      Throws:
      CBLException
    • clearOutParameters

      public void clearOutParameters()
      clear the previously assigned output-parameters, allowing new output-parameters to be assigned.
    • setInParameter

      public void setInParameter(int position, ISMDataType valueHolder)
      Set input parameters for prepared SQL query containing INSERT/UPDATE
    • setInParameter

      public void setInParameter(int position, ISMObject valueHolder, ISMInteger nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
      Parameters:
      position - int
      valueHolder - ACMObject
      nullIndicator - ACMObject
    • setInParameterOn49Group

      public void setInParameterOn49Group(int position, ISMGroup group, ISMInteger nullIndicator)
      Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setInParameterOn49Group(int position, ISMGroup valueHolder)
    • setInParameterOn49Group

      public void setInParameterOn49Group(int position, ISMGroup group)
      Special case for set input parameters for prepared query For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    • setInParameter

      public void setInParameter(int position, int value)
      Set input parameters for prepared query
      Parameters:
      position - int
      value - Integer
    • setInParameter

      public void setInParameter(int position, long value)
      Set input parameters for prepared query
      Parameters:
      position - int
      value - Integer
    • setInParameter

      public void setInParameter(int position, String value)
      Set input parameters for prepared query
      Parameters:
      position - int
      value - Integer
    • setInParameter

      public void setInParameter(int position, byte[] value)
      Set input parameters for prepared query
    • setInParameter

      public void setInParameter(int position, String value, ISMInteger nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
    • setInParameter

      public void setInParameter(int position, String value, int nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
    • setInParameter

      public void setInParameter(int position, double newValue, int nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
    • setInParameter

      public void setInParameter(int position, BigDecimal newValue, int nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
    • setInParameter

      public void setInParameter(int position, Date value)
      Set input parameters for prepared query
      Parameters:
      position - int
      value - Integer
    • setInParameter

      public void setInParameter(int position, double value)
      Set input parameters for prepared query
    • setInParameter

      public void setInParameter(int position, BigDecimal value)
      Set input parameters for prepared query
    • setInParameter

      public void setInParameter(int position, CBLBean valueHolder)
    • setInParameter

      public void setInParameter(int position, ISMBean valueHolder, ISMInteger nullIndicator)
      Set input parameters for prepared SQL query containing INSERT/UPDATE, and take account of Null indicator. Conditions :
      • When "nullIndicator" is set to -1, the Parameter is set to NULL
      • When "nullIndicator" is set to 0, the Parameter is set to current-value of parameter
      • When "nullIndicator" is set to >0, this is invalid for this type of statement, throw an exception
    • setOutParameter

      public void setOutParameter(int position, ISMDataType valueHolder)
      Bind output input parameters for prepared query
      Parameters:
      position - int
      valueHolder - ACMObject
    • setOutParameter

      public void setOutParameter(int position, CBLBean wrapper)
      Bind output input parameters for prepared query
      Parameters:
      position - int
      wrapper - ISMBean - setOutParameter(position, wrapper.getTopLevelField())
    • setOutParameter

      public void setOutParameter(int position, ISMDataType valueHolder, ISMDataType nullIndicator)
      Bind output input parameters for prepared query
      Parameters:
      position - int
      valueHolder - ACMObject
      null - Indicator ACMObject
    • setOutParameterOn49Group

      public void setOutParameterOn49Group(int position, ISMGroup valueHolder)
      Special case for set Output parameters for prepared query DB2 VARCHAR's can be declared in COBOL as a field, or as group items containing only two elementary items, both of which must have a level number of 49. In the 49 case - The first item is a 2-byte field declared with usage COMP or COMP-5 that represents the effective length of the character string. The second item is a PIC X(n) data type and holds the actual data. If the data being copied to a SQL CHAR, VARCHAR or LONG VARCHAR data type is longer than the defined length, then the data is truncated and the SQLWARN1 flag in the SQLCA data structure is set. If the data is smaller than the defined length, a receiving CHAR data type may be padded with blanks.
      Parameters:
      position - int
      valueHolder - ISMGroup representing a 49 level Element with 2 fields, 1 numeric and one String
    • setOutParameterOn49Group

      public void setOutParameterOn49Group(int position, CBLBean wrapper)
      Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    • setOutParameterOn49Group

      public void setOutParameterOn49Group(int position, ISMGroup valueHolder, ISMObject nullIndicator)
      Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    • setOutParameterOn49Group

      public void setOutParameterOn49Group(int position, ISMBean bean, ISMObject nullIndicator)
      Special case for setting Output parameters for DB2 - 49 Level groups For more information see the java-doc for setOutParameterOn49Group(int position, ISMGroup valueHolder)
    • getESQLBaseService

      protected ESQLBaseService getESQLBaseService()
    • releaseResources

      public void releaseResources(boolean releaseConnection)
      close connection, and set owning ESQLBaseService to Null - for improved GC
    • getConnection

      public Connection getConnection()
      get connection from connectionFactory
    • setConnection

      public void setConnection(Connection connection)
    • releaseConnection

      public void releaseConnection()
      CloseConnection is used internally on destroy of the application
    • processSQLException

      protected int processSQLException(SQLException e, ISMBean sqlca, boolean afterEndOfResultset) throws CBLException
      Sets the appropriate values on SQLCA
      Parameters:
      e -
      sqlca -
      afterEndOfResultset -
      Throws:
      CBLException
    • processSQLException

      protected int processSQLException(SQLException e, ISMBean sqlca, int theRowCount) throws CBLException
      Sets the appropriate values on SQLCA
      Parameters:
      e -
      sqlca -
      theRowCount -
      Throws:
      CBLException
    • getRowCount

      public int getRowCount()
    • commit

      public void commit()
      This method uses the commit method on java.sql.Connection. Therefore ALL THE SQL statements which have used this connection will get Commited.
    • forceCommit

      public void forceCommit()
      When auto-commit is not used, this method will force a connection.commit() - whether the system is using BATCH processing or not. This is also called on goBack() and on release of the owning BaseService. The method can also be used manually to force a connection.commit() when using BATCH processing (batchSize of greater than one).
    • rollback

      public void rollback()
      rollback the sql
      Only works when AUTO-COMMIT is switched off in db.properties. If autocommit is on, then use
        sqlprocessor.prepare("ROLLBACK");
              sqlprocessor.executeUpdate();
      The method uses the Rollback method on java.sql.Connection. Therefore ALL THE SQL statements which have used this connection will get Rolled back .
    • forceRollback

      public void forceRollback()
      When auto-commit is not used, this method will force a connection.rollback() - whether the system is using BATCH processing or not. This is also called on abort() of the owning BaseService. The method can also be used manually to force a connection.rollback() when using BATCH processing (batchSize of greater than one).
    • getSQLCA

      public ISMBean getSQLCA()
      Returns:
      ISMBean
    • getDbPropertiesURI

      public String getDbPropertiesURI()
      get URI to db.properties file.
      Returns:
    • setDbPropertiesURI

      public void setDbPropertiesURI(String dbPropertiesURI)
    • prepareSQLFromFile

      public void prepareSQLFromFile(String fileName)
      Allows externalization of SQL scripts. Loads the sql scripts from from "getResource()/sql" directory
      Parameters:
      fileName -
    • prepareSQLFromFile

      public void prepareSQLFromFile(String fileName, boolean isForUpdate)
      Allows externalization of SQL scripts. Loads the sql scripts from from "getResource()/sql" directory
      Parameters:
      fileName -
      isForUpdate - : true when used for SELECT ... FOR UPDATE OF Cursor-name
    • formatSQL

      protected String formatSQL(String theSql)
      This method is intended to be overridden. Any static preparation of SQL Code should be done via this method. For example, to append the tablenames with OWNER or Schema name ...
    • resetSqlca

      protected void resetSqlca()
      Assign appropriate (normal return) values to SQLCA
    • setClearOutParametersOnGet

      public void setClearOutParametersOnGet(boolean newValue)
      By-default, the system will NOT clear the OutputParameters after a executeQuery/OpenCursor/Fetch/Next This method allows the developers to override the functionality -
    • setFetchSize

      public void setFetchSize(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,
    • deleteRow

      public void deleteRow()
      delete the current row
    • getResultset

      public ResultSet getResultset()
    • updateRow

      public void updateRow()
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, String value)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, ISMGroup theContainer)
    • updateColumnValue

      public void updateColumnValue(int columnIndex, int value)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, double value)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, long value)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, ISMString valueObj)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, ISMDouble valueObj)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do cursor.updateColumnValue(1, newValue);
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, ISMInteger valueObj)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • updateColumnValue

      public void updateColumnValue(int columnIndex, ISMLong valueObj)
      Used in db2's SELECT col1 From table FOR UPDATE
      first the system will do cursor.executeQuery()
      later it can do
      cursor.updateColumnValue(1, newValue);
      cursor.updateRow();
      in this example, the value of "col1" will be updated
    • getPreparedStatement

      public PreparedStatement getPreparedStatement()
    • isStatusNormal

      public boolean isStatusNormal()
    • isStatusNullReturn

      public boolean isStatusNullReturn()
    • isStatusDuplicateInsert

      public boolean isStatusDuplicateInsert()
    • isStatusMultipleEntries

      public boolean isStatusMultipleEntries()
    • isStatusTimeout

      public boolean isStatusTimeout()
    • isStatusTimeoutNoTimeout

      public boolean isStatusTimeoutNoTimeout()
    • isStatusError

      public boolean isStatusError()
    • isStatusOpenCloseError

      public boolean isStatusOpenCloseError()
    • isStatusCursorNotOpenError

      public boolean isStatusCursorNotOpenError()
    • isStatusNoEntry

      public boolean isStatusNoEntry()
    • isStatusAfterEndOfResultset

      public boolean isStatusAfterEndOfResultset()