Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.server.sql
Class IfsConnection

    java.lang.Object
      oracle.ifs.share.sql.ConnectionWrapper
          oracle.ifs.server.sql.IfsConnection

    public class IfsConnection

extends ConnectionWrapper

An IfsConnection is a special type of ConnectionWrapper used when the underlying JDBC connection is obtained from a server-side session context.

(Published)

Constructor Summary
`IfsConnection(S_LibrarySession session)` Constructs a ConnectionWrapper.

Method Summary
`void` | `commit()` Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the ConnectionWrapper.
`protected CallableStatementWrapper` | `constructCallableStatementWrapper(java.sql.CallableStatement cstmt)` Constructs a CallableStatementWrapper.
`protected PreparedStatementWrapper` | `constructPreparedStatementWrapper(java.sql.PreparedStatement pstmt)` Constructs a PreparedStatementWrapper.
`protected StatementWrapper` | `constructStatementWrapper(java.sql.Statement stmt)` Constructs a StatementWrapper.
`boolean` | `execute(java.sql.PreparedStatement pstmt)` Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.
`boolean` | `execute(java.sql.Statement stmt, java.lang.String sql)` Execute a SQL statement that may return multiple results.
`int[]` | `executeBatch(java.sql.Statement stmt)` Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.
`java.sql.ResultSet` | `executeQuery(java.sql.PreparedStatement pstmt)` A prepared SQL query is executed and its ResultSet is returned.
`java.sql.ResultSet` | `executeQuery(java.sql.Statement stmt, java.lang.String sql)` Execute a SQL statement that returns a single ResultSet.
`int` | `executeUpdate(java.sql.PreparedStatement pstmt)` Execute a SQL INSERT, UPDATE or DELETE statement.
`int` | `executeUpdate(java.sql.Statement stmt, java.lang.String sql)` Execute a SQL INSERT, UPDATE or DELETE statement.
`void` | `rollback()` Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the ConnectionWrapper.
`void` | `setAutoCommit(boolean autoCommit)` If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions.
`void` | `setCatalog(java.lang.String catalog)` A sub-space of this ConnectionWrapper's database may be selected by setting a catalog name.
`void` | `setReadOnly(boolean readOnly)` You can put a connection in read-only mode as a hint to enable database optimizations.
`void` | `setTransactionIsolation(int level)` You can call this method to try to change the transaction isolation level using one of the TRANSACTION_* values.

Methods inherited from class oracle.ifs.share.sql.ConnectionWrapper
`clearWarnings, createStatement, dispose, getAutoCommit, getCatalog, getMetaData, getTransactionIsolation, getWarnings, initialize, isClosed, isReadOnly, nativeSQL, prepareCall, prepareStatement`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IfsConnection

    public IfsConnection(S_LibrarySession session)
                  throws IfsException

  Constructs a ConnectionWrapper.

  Parameters:
    `session` - the serverside LibrarySession
  Throws:
    `IfsException` - if the operation fails
  (Unpublished)

Method Detail

### constructStatementWrapper

    protected StatementWrapper constructStatementWrapper(java.sql.Statement stmt)

  Description copied from class: `IfsConnection`
  Constructs a StatementWrapper.

  This can be overridden to construct a subclass of StatementWrapper.

  Overrides:
    `constructStatementWrapper` in class `ConnectionWrapper`
  Parameters:
    `stmt` - the Statement to wrap
  Returns:
    a new StatementWrapper

### constructPreparedStatementWrapper

    protected PreparedStatementWrapper constructPreparedStatementWrapper(java.sql.PreparedStatement pstmt)

  Description copied from class: `IfsConnection`
  Constructs a PreparedStatementWrapper.

  This can be overridden to construct a subclass of PreparedStatementWrapper.

  Overrides:
    `constructPreparedStatementWrapper` in class `ConnectionWrapper`
  Parameters:
    `pstmt` - the PreparedStatement to wrap
  Returns:
    a new PreparedStatementWrapper

### constructCallableStatementWrapper

    protected CallableStatementWrapper constructCallableStatementWrapper(java.sql.CallableStatement cstmt)

  Description copied from class: `IfsConnection`
  Constructs a CallableStatementWrapper.

  This can be overridden to construct a subclass of CallableStatement.

  Overrides:
    `constructCallableStatementWrapper` in class `ConnectionWrapper`
  Parameters:
    `cstmt` - the CallableStatement to wrap
  Returns:
    a new CallableStatementWrapper

### executeQuery

    public java.sql.ResultSet executeQuery(java.sql.Statement stmt,
                                           java.lang.String sql)
                                    throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Execute a SQL statement that returns a single ResultSet.

  Overrides:
    `executeQuery` in class `ConnectionWrapper`
  Parameters:
    `stmt` - the Statement
    `sql` - typically this is a static SQL SELECT statement
  Returns:
    a ResultSet that contains the data produced by the query; never null
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### executeUpdate

    public int executeUpdate(java.sql.Statement stmt,
                             java.lang.String sql)
                      throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Execute a SQL INSERT, UPDATE or DELETE statement. Although SQL DDL statements can be executed, it is not advised since doing so can cause the iFS repository to be non-functional or irreparable.

  Overrides:
    `executeUpdate` in class `ConnectionWrapper`
  Parameters:
    `stmt` - the Statement
    `sql` - a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
  Returns:
    either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### execute

    public boolean execute(java.sql.Statement stmt,
                           java.lang.String sql)
                    throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Execute a SQL statement that may return multiple results. Under some (uncommon) situations a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this, unless you're executing a stored procedure that you know may return multiple results, or unless you're dynamically executing an unknown SQL string. The "execute", "getMoreResults", "getResultSet" and "getUpdateCount" methods let you navigate through multiple results. The "execute" method executes a SQL statement and indicates the form of the first result. You can then use getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

  Overrides:
    `execute` in class `ConnectionWrapper`
  Parameters:
    `stmt` - any SQL statement
    `sql` - the SQL string
  Returns:
    true if the next result is a ResultSet; false if it is an update count or there are no more results
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### executeBatch

    public int[] executeBatch(java.sql.Statement stmt)
                       throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

  Overrides:
    `executeBatch` in class `ConnectionWrapper`
  Parameters:
    `stmt` - any SQL statement
  Returns:
    an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### executeQuery

    public java.sql.ResultSet executeQuery(java.sql.PreparedStatement pstmt)
                                    throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  A prepared SQL query is executed and its ResultSet is returned.

  Overrides:
    `executeQuery` in class `ConnectionWrapper`
  Parameters:
    `pstmt` - the SQL statement
  Returns:
    a ResultSet that contains the data produced by the query; never null
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### executeUpdate

    public int executeUpdate(java.sql.PreparedStatement pstmt)
                      throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Execute a SQL INSERT, UPDATE or DELETE statement. Although SQL DDL statements can be executed, it is not advised since doing so can cause the iFS repository to be non-functional or irreparable.

  Overrides:
    `executeUpdate` in class `ConnectionWrapper`
  Parameters:
    `pstmt` - the SQL statement
  Returns:
    either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### execute

    public boolean execute(java.sql.PreparedStatement pstmt)
                    throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.

  Overrides:
    `execute` in class `ConnectionWrapper`
  Parameters:
    `pstmt` - the SQL statement
  Returns:
    execution status
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### setAutoCommit

    public void setAutoCommit(boolean autoCommit)
                       throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by either commit() or rollback(). By default, new connections are in auto-commit mode. The commit occurs when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or the ResultSet has been closed. In advanced cases, a single statement may return multiple results as well as output parameter values. Here the commit occurs when all results and output param values have been retrieved.

  Overrides:
    `setAutoCommit` in class `ConnectionWrapper`
  Parameters:
    `autoCommit` - true enables auto-commit; false disables auto-commit.
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### commit

    public void commit()
                throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the ConnectionWrapper. This method should only be used when auto commit has been disabled.

  Overrides:
    `commit` in class `ConnectionWrapper`
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### rollback

    public void rollback()
                  throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the ConnectionWrapper. This method should only be used when auto commit has been disabled.

  Overrides:
    `rollback` in class `ConnectionWrapper`
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### setReadOnly

    public void setReadOnly(boolean readOnly)
                     throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  You can put a connection in read-only mode as a hint to enable database optimizations.

  Note: setReadOnly cannot be called while in the middle of a transaction.

  Overrides:
    `setReadOnly` in class `ConnectionWrapper`
  Parameters:
    `readOnly` - true enables read-only mode; false disables read-only mode.
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### setCatalog

    public void setCatalog(java.lang.String catalog)
                    throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  A sub-space of this ConnectionWrapper's database may be selected by setting a catalog name. If the driver does not support catalogs it will silently ignore this request.

  Overrides:
    `setCatalog` in class `ConnectionWrapper`
  Parameters:
    `catalog` - tthe catalog name
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

### setTransactionIsolation

    public void setTransactionIsolation(int level)
                                 throws java.sql.SQLException

  Description copied from class: `IfsConnection`
  You can call this method to try to change the transaction isolation level using one of the TRANSACTION_* values.

  Note: setTransactionIsolation cannot be called while in the middle of a transaction.

  Overrides:
    `setTransactionIsolation` in class `ConnectionWrapper`
  Parameters:
    `level` - one of the TRANSACTION_* isolation values with the exception of TRANSACTION_NONE; some databases may not support other values
  Throws:
    `java.sql.SQLException` - if a database-access error occurs.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD