Class DmlStatement

All Implemented Interfaces:
OracleResourceUser
Direct Known Subclasses:
QueryStatement

public abstract class DmlStatement extends StatementParameters2 implements OracleResourceUser
A parameterized SQL statement that continues to exist even if the connection it uses is withdrawn.

Under normal circumstances MCPDBWizard users will have no reason to use this class directly - the generated code will use it.

Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)

Version:
7
Author:
[email protected]
  • Constructor Details

    • DmlStatement

      public DmlStatement(String statementSqlText, LogInterface theLog, Connection theConnection)
      Create a DML Statement object and give it a connection
    • DmlStatement

      public DmlStatement(String statementSqlText, LogInterface theLog)
      Create a DML Statement object.
  • Method Details

    • setConnection

      public void setConnection(Connection theConnection)
      Provide a connection
      Parameters:
      theConnection -
    • testConnection

      protected void testConnection() throws CSDBException
      Complain if the connection does not exist.
      Throws:
      CSDBException - No database connection was available when this method was called
    • createPreparedStatement

      protected boolean createPreparedStatement() throws CSDBException
      Prepare the statement if needed.
      Returns:
      true if we had to prepare the statement false if the statement was already prepared
      Throws:
      CSDBException - We were unable to prepare the statement
    • freeConnection

      public void freeConnection()
      Release the current connection

      The prepared Statement will be closed and nullified.

    • connectionIsUsable

      public boolean connectionIsUsable()
      Check if our connection is usable
      Returns:
      true if our connecion is usable false if our connecion is not usable
    • hasResources

      public boolean hasResources()
      Used to tell if the object is using Oracle resources.
      Specified by:
      hasResources in interface OracleResourceUser
      Returns:
      true if the object holds a resource. false if the object does not hold a resource.
    • releaseResources

      public boolean releaseResources()
      Used to tell an object to release its Oracle resources. This method never throws an exception. If releasing the resource will create problems they should be dealt with by the implementing class, not escalated to the calling class.
      Specified by:
      releaseResources in interface OracleResourceUser
      Returns:
      true if the objects held an open PreparedStatement, ResultSet or similer resource.
    • getUnderlyingStatement

      public Statement getUnderlyingStatement() throws CSDBException
      Return underlying java.sql.Statement Object. This method exists so that users can call the various methods such as 'setQueryTimeout' that are defined in the java.sql.Statement interface. Do not use it to replace the Statement object.
      Returns:
      java.sql.Statement
      Throws:
      CSDBException - If we had to try to create the Statement before we could return it and something went wrong.
      Since:
      5.0.2267 Retuens Statement Object.