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 Link icon

    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 Link icon

    Constructors
    Constructor
    Description
    Constructor
    constructor -
  • Method Summary Link icon

    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 Link icon

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

    • userDefinedConnection Link icon

      protected Connection userDefinedConnection
      Connection to the database
    • preparedStatement Link icon

      protected PreparedStatement preparedStatement
    • lastQuery Link icon

      protected String lastQuery
    • logger Link icon

      protected static Log logger
    • totalRuntime Link icon

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

      public static long totalRuntime_prepareFromFile
  • Constructor Details Link icon

    • ESQLProcessor Link icon

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

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

    • setSQLCA Link icon

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

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

      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 Link icon

      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 Link icon

      @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 Link icon

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

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

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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

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

      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 Link icon

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      protected ESQLBaseService getESQLBaseService()
    • releaseResources Link icon

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

      public Connection getConnection()
      get connection from connectionFactory
    • setConnection Link icon

      public void setConnection(Connection connection)
    • releaseConnection Link icon

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

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

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

      public int getRowCount()
    • commit Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public ISMBean getSQLCA()
      Returns:
      ISMBean
    • getDbPropertiesURI Link icon

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

      public void setDbPropertiesURI(String dbPropertiesURI)
    • prepareSQLFromFile Link icon

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

      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 Link icon

      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 Link icon

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

      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 Link icon

      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 Link icon

      public void deleteRow()
      delete the current row
    • getResultset Link icon

      public ResultSet getResultset()
    • updateRow Link icon

      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 Link icon

      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 Link icon

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public PreparedStatement getPreparedStatement()
    • isStatusNormal Link icon

      public boolean isStatusNormal()
    • isStatusNullReturn Link icon

      public boolean isStatusNullReturn()
    • isStatusDuplicateInsert Link icon

      public boolean isStatusDuplicateInsert()
    • isStatusMultipleEntries Link icon

      public boolean isStatusMultipleEntries()
    • isStatusTimeout Link icon

      public boolean isStatusTimeout()
    • isStatusTimeoutNoTimeout Link icon

      public boolean isStatusTimeoutNoTimeout()
    • isStatusError Link icon

      public boolean isStatusError()
    • isStatusOpenCloseError Link icon

      public boolean isStatusOpenCloseError()
    • isStatusCursorNotOpenError Link icon

      public boolean isStatusCursorNotOpenError()
    • isStatusNoEntry Link icon

      public boolean isStatusNoEntry()
    • isStatusAfterEndOfResultset Link icon

      public boolean isStatusAfterEndOfResultset()