oracle.jdbc.driver
Class OracleConnection

oracle.jdbc.driver.OracleConnection

public class OracleConnection

The OracleConnection class implements the JDBC Connection interface.


Field Summary
static int ASCII_TO_CHAR
           
static int CHAR_TO_ASCII
           
static int CHAR_TO_JAVACHAR
           
static int CHAR_TO_UNICODE
           
 oracle.jdbc.driver.DBConversion conversion
           
 oracle.jdbc.driver.DBAccess db_access
           
static int GLOBAL_TXN
           
static int JAVACHAR_TO_CHAR
           
 oracle.jdbc.driver.LobDBAccessImpl lob_dbaccess
           
static int LOCAL_TXN
           
 int m_txn_mode
           
static int NO_TXN
           
static int NONE
           
static int RAW_TO_ASCII
           
static int RAW_TO_JAVACHAR
           
static int RAW_TO_UNICODE
           
static int UNICODE_TO_CHAR
           
 boolean UsingXA
           
 boolean XA_wants_error
           
 
Constructor Summary
OracleConnection(oracle.jdbc.driver.DBAccess access, java.lang.String ur, java.lang.String us, java.lang.String p, java.lang.String db, java.util.Properties info)
          Constructor for an Oracle connection.
 
Method Summary
 void archive(int mode, int aseq, java.lang.String acstext)
           
 void assertComplete()
          Deprecated.  
 void cacheExplicitStatement(OraclePreparedStatement stmt, java.lang.String key)
          cacheExplicitStatement Adds the supplied statement to the explicit cache with the supplied key.
 void cacheImplicitStatement(OraclePreparedStatement stmt, java.lang.String sql, int statementType, int scrollType)
          cacheImplicitStatement Adds the supplied statement to the implicit cache, using the supplied sql string, statement type, and scroll type.
 void clearClientIdentifier(java.lang.String clientId)
          Clear the client identifier for this session.
 void clearWarnings()
           
 void close()
          Rollbacks the current transaction.
 void commit()
           
 oracle.jdbc.driver.BfileDBAccess createBfileDBAccess()
           
 oracle.jdbc.driver.BlobDBAccess createBlobDBAccess()
           
 oracle.jdbc.driver.ClobDBAccess createClobDBAccess()
           
 java.sql.Statement createStatement()
          createStatement just allocates a new statement object.
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a Statement object that will generate ResultSet objects with the given type and concurrency.
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          JDBC 3.0 Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 boolean getAutoClose()
          We are always in auto-close mode.
 boolean getAutoCommit()
           
 java.sql.CallableStatement getCallWithKey(java.lang.String key)
          getCallWithKey Searches the explicit cache for a match on key.
 java.lang.String getCatalog()
          We do not support catalogs.
 java.lang.Object getClientData(java.lang.Object key)
          Obtain the client data value associated with a key.
 boolean getCreateStatementAsRefCursor()
          Retrieve the current setting of the createStatementAsRefCursor flag.
 java.lang.String getDatabaseProductVersion()
          What's the version of this database product?
 short getDbCsId()
          Obtain the Oracle identifier of the character set used in the database server.
 boolean getDefaultAutoRefetch()
          Oracle extension.
 int getDefaultExecuteBatch()
          Allows the user to retrieve the batch value for the connection.
 boolean getDefaultFixedString()
          Returns the current setObject(string) behavior for Statements created from this Connection. By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics.
 int getDefaultRowPrefetch()
          Allows the user to retrieve the row prefetch value for the connection.
 java.lang.Object getDescriptor(byte[] toid)
          Return the matched StructDescriptor.
 java.lang.Object getDescriptor(java.lang.String sql_name)
          Return the matched StructDescriptor.
 boolean getExplicitCachingEnabled()
          getExplicitCachingEnabled Returns true if the explicit cache is currently enabled, false otherwise.
 int getHoldability()
          JDBC 3.0 Retrieves the current holdability of ResultSet objects created using this Connection object.
 boolean getImplicitCachingEnabled()
          getImplicitCachingEnabled Returns true if the implicit cache is currently enabled, false otherwise.
 boolean getIncludeSynonyms()
          Returns true if DatabaseMetaData.getColumns will report information if a table synonym is passed in, and false otherwise.
 java.lang.Object getJavaObject(java.lang.String sql_name)
           
 short getJdbcCsId()
          Obtain the Oracle identifier of the character set used in the JDBC driver.
 java.sql.DatabaseMetaData getMetaData()
          We just return a oracle.oci8.DatabaseMetaData object.
 short getNCsId()
           
 java.util.Properties getProperties()
           
 boolean getRemarksReporting()
          Return true if the DatabaseMetaData calls getTables and getColumns will report the REMARKS column.
 boolean getReportRemarks()
           
 boolean getRestrictGetTables()
          Returns true if the information returned by DatabaseMetaData.getTables is restricted, and false otherwise.
 java.lang.String getSessionTimeZone()
          Obtain Oracle session time zone region name.
 java.lang.String getSQLType(java.lang.Object obj)
           
 int getStatementCacheSize()
          getStatementCacheSize Returns the current size of the application cache.
 java.sql.PreparedStatement getStatementWithKey(java.lang.String key)
          getStatementWithKey Searches the explicit cache for a match on key.
 int getStmtCacheSize()
          Deprecated. Use getStatementCacheSize instead.
 short getStructAttrCsId()
          Obtain the Oracle identifier of the character set used in STRUCT attributes.
 short getStructAttrNCsId()
           
 boolean getSynchronousMode()
          Deprecated.  
 int getTransactionIsolation()
          We only support dirty reads.
 java.util.Map getTypeMap()
           
 java.lang.String getUserName()
           
 boolean getUsingXAFlag()
           
 short getVersionNumber()
           
 java.sql.SQLWarning getWarnings()
          Return the current warning, if any
 OracleConnection getWrapper()
           
 boolean getXAErrorFlag()
           
 void holdLine(oracle.jdbc.internal.OracleStatement stmt)
           
 void holdLine(oracle.jdbc.internal.OracleStatement stmt)
           
 void initUserName()
           
 boolean isAccumulateBatchResult()
          Check the batching type of the connection
 boolean isClosed()
          As we do not keep a state in the Java struct we call native method even for isClosed.
 boolean isLogicalConnection()
          Method that returns a boolean indicating whether its a logical connection or not.
 boolean isReadOnly()
          Checking if the Connection is read only or not.
 boolean isStatementCacheInitialized()
           
 java.lang.String nativeSQL(java.lang.String sql)
          This is a bogus and quickly done implementation waiting for something better
 void needLine()
           
 java.lang.Object openJoltConnection(java.lang.String apiName, short major, short minor)
          Deprecated.  
 void oracleReleaseSavepoint(OracleSavepoint savepoint)
          Oracle extension Removes the given oracle.jdbc.OracleSavepoint object from the current transaction.
 void oracleRollback(OracleSavepoint savepoint)
          Oracle extension Undoes all the changes made after the given oracle.jdbc.OracleSavepoint object was set.
 OracleSavepoint oracleSetSavepoint()
          Oracle extension Creates an unnamed savepoint in the current transaction and returns the new oracle.jdbc.OracleSavepoint object that represents it.
 OracleSavepoint oracleSetSavepoint(java.lang.String name)
          Oracle extension Creates a savepoint with the given name in the current transaction and returns the new oracle.jdbc.OracleSavepoint object that represents it.
 int pingDatabase(int timeOut)
          ping Database and return status of connection
 java.sql.CallableStatement prepareCall(java.lang.String sql)
          This is similar to createStatement.
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          JDBC 3.0 Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
 java.sql.CallableStatement prepareCallWithKey(java.lang.String key)
          This is same as prepareCall, except if a Callable Statement with the given KEY exists in the Cache, then the statement is returned AS IT IS when it was closed and cached with this KEY.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
          This is similar to createStatement.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys)
          JDBC 3.0 Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes)
          JDBC 3.0 Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          JDBC 3.0 Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames)
          JDBC 3.0 Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 java.sql.PreparedStatement prepareStatementWithKey(java.lang.String key)
          Deprecated. This is same as prepareStatement, except if a Prepared Statement with the given KEY exists in the Cache, then the statement is returned AS IT IS when it was closed and cached with this KEY. An object returned from the Cache based on Key will have its state set to "EXPLICIT". If no such Prepared Statement is found, a null is returned. Key cannot be null.
 void purgeExplicitCache()
          purgeExplicitCache Removes all existing statements from the explicit cache, after which it will be empty.
 void purgeImplicitCache()
          purgeImplicitCache Removes all existing statements from the implicit cache, after which it will be empty.
 void putDescriptor(byte[] toid, java.lang.Object desc)
          Store the Object Descriptor for later usage.
 void putDescriptor(java.lang.String sql_name, java.lang.Object desc)
          Store the Object Descriptor for later usage.
 void registerApiDescription(java.lang.String apiName, short major, short minor, java.lang.String className)
          Deprecated.  
 void registerCloseCallback(oracle.jdbc.driver.OracleCloseCallback occ, java.lang.Object privData)
           
 void registerSQLType(java.lang.String sql_name, java.lang.Class java_class)
           
 void registerSQLType(java.lang.String sql_name, java.lang.String java_class_name)
          Map accessor methods
 void releaseLine()
           
 void releaseSavepoint(java.sql.Savepoint savepoint)
           
 java.lang.Object removeClientData(java.lang.Object key)
          Remove the specified key and any associated client data.
 void rollback()
           
 void rollback(java.sql.Savepoint savepoint)
           
 void setAccumulateBatchResult(boolean val)
          Set if the batching type for the connection
 void setAutoClose(boolean autoClose)
          We are always in auto-close mode.
 void setAutoCommit(boolean autoCommit)
           
 void setCatalog(java.lang.String catalog)
          We do not support catalogs.
 java.lang.Object setClientData(java.lang.Object key, java.lang.Object value)
          Store a piece client data and associate it with the specified key.
 void setClientIdentifier(java.lang.String clientId)
          Set the client identifier for this session.
 void setCreateStatementAsRefCursor(boolean value)
          When this is set to true, any new statements created from this connection will be created as a REF CURSOR.
 void setDefaultAutoRefetch(boolean autoRefetch)
          Oracle extension.
 void setDefaultExecuteBatch(int batch)
          Set the batch value for executes for all prepared statements belonging to this connection and created after the batch value was set.
 void setDefaultFixedString(boolean fixedString)
          Changes the default setObject(string) behavior for Statements created from this Connection. By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics.
 void setDefaultRowPrefetch(int value)
          Set the value of row prefetch for all statements associated with this connection and created after this value was set.
 void setExplicitCachingEnabled(boolean cache)
          setExplicitCachingEnabled Enables or disables the explicit cache.
 void setHoldability(int holdability)
          JDBC 3.0 Changes the holdability of ResultSet objects created using this Connection object to the given holdability.
 void setImplicitCachingEnabled(boolean cache)
          setImplicitCachingEnabled Enables or disables the implicit cache.
 void setIncludeSynonyms(boolean synonyms)
          Turn on or off retrieval of synonym information in DatabaseMetaData.
 void setReadOnly(boolean value)
          Sets the Connection as read only if the value is true and the enables the Connection for writing (updat/delete/insert) with the value as false.
 void setRemarksReporting(boolean reportRemarks)
          Turn on or off the reporting of the REMARKS columns by the getTables and getColumns calls of the DatabaseMetaData interface. The DatabaseMetaData calls getTables and getColumns are extremely slow if the REMARKS column has to be reported as this necessitates an expensive outer join so by default the JDBC driver does not report the REMARKS columns. You can turn the reporting of REMARKS on by passing a true argument to this method.
 void setRestrictGetTables(boolean restrict)
          Turn on or off the restriction of the returned data in DatabaseMetaData.
 java.sql.Savepoint setSavepoint()
           
 java.sql.Savepoint setSavepoint(java.lang.String name)
           
 void setSessionTimeZone(java.lang.String regionName)
          Set the session time zone.
 void setStatementCacheSize(int size)
          setStatementCacheSize Specifies the size of the size of the application cache (which will be used by both implicit and explicit caching).
 void setStmtCacheSize(int size)
          Deprecated. Use setStatementCacheSize instead.
 void setStmtCacheSize(int size, boolean clearMetaData)
          Deprecated. Use setStatementCacheSize instead.
 void setSynchronousMode(boolean isSynchronous)
          Deprecated.  
 void setTransactionIsolation(int level)
          We only support dirty reads.
 void setTypeMap(java.util.Map map)
           
 void setUsingXAFlag(boolean value)
           
 void setWrapper(OracleConnection w)
           
 void setXAErrorFlag(boolean value)
           
 void shutdown(int mode)
           
 void startup(java.lang.String startup_str, int mode)
           
 void trace(java.lang.String s)
           
 OracleConnection unwrap()
           
static OracleConnection unwrapCompletely(OracleConnection wrappedConnection)
          This method will take an oracle.jdbc.OracleConnection object as an argument and repeatedly call the unwrap method until it has reached null.
 

Field Detail

db_access

public oracle.jdbc.driver.DBAccess db_access

conversion

public oracle.jdbc.driver.DBConversion conversion

lob_dbaccess

public oracle.jdbc.driver.LobDBAccessImpl lob_dbaccess

XA_wants_error

public boolean XA_wants_error

UsingXA

public boolean UsingXA

m_txn_mode

public int m_txn_mode

GLOBAL_TXN

public static final int GLOBAL_TXN

LOCAL_TXN

public static final int LOCAL_TXN

NO_TXN

public static final int NO_TXN

CHAR_TO_ASCII

public static final int CHAR_TO_ASCII

CHAR_TO_UNICODE

public static final int CHAR_TO_UNICODE

RAW_TO_ASCII

public static final int RAW_TO_ASCII

RAW_TO_UNICODE

public static final int RAW_TO_UNICODE

UNICODE_TO_CHAR

public static final int UNICODE_TO_CHAR

ASCII_TO_CHAR

public static final int ASCII_TO_CHAR

NONE

public static final int NONE

JAVACHAR_TO_CHAR

public static final int JAVACHAR_TO_CHAR

RAW_TO_JAVACHAR

public static final int RAW_TO_JAVACHAR

CHAR_TO_JAVACHAR

public static final int CHAR_TO_JAVACHAR
Constructor Detail

OracleConnection

public OracleConnection(oracle.jdbc.driver.DBAccess access,
                        java.lang.String ur,
                        java.lang.String us,
                        java.lang.String p,
                        java.lang.String db,
                        java.util.Properties info)
                 throws java.sql.SQLException
Constructor for an Oracle connection.

This method allocates a new OracleConnection. It calls the native method "connect" that does the actual work.

Throws:
java.sql.SQLException - if failed to make the connection.
Method Detail

getProperties

public java.util.Properties getProperties()

isLogicalConnection

public boolean isLogicalConnection()
Method that returns a boolean indicating whether its a logical connection or not.
Returns:
boolean true if this is a logical connection

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
createStatement just allocates a new statement object. The statement has a pointer to the connection object.

Returns:
a new OracleStatement object
Throws:
java.sql.SQLException - if a database access error occurs

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.SQLException
JDBC 2.0 Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and result set concurrency type to be overridden.
Parameters:
resultSetType - a result set type; see ResultSet.TYPE_XXX
Returns:
a new Statement object
Throws:
java.sql.SQLException - if a database access error occurs

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
This is similar to createStatement. We accept both ODBC syntax and Oracle syntax for SQL statements.
Parameters:
sql - The query for which the cursor has to be created
Returns:
a new OraclePreparedStatement object
Throws:
java.sql.SQLException - if a database access error occurs

prepareStatementWithKey

public java.sql.PreparedStatement prepareStatementWithKey(java.lang.String key)
                                                   throws java.sql.SQLException
Deprecated. This is same as prepareStatement, except if a Prepared Statement with the given KEY exists in the Cache, then the statement is returned AS IT IS when it was closed and cached with this KEY. An object returned from the Cache based on Key will have its state set to "EXPLICIT". If no such Prepared Statement is found, a null is returned. Key cannot be null.
Parameters:
key - the key with which it was closed
Returns:
a OraclePreparedStatement object
Throws:
java.sql.SQLException - if a database access error occurs

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException
JDBC 2.0 Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareStatement method above, but it allows the default result set type and result set concurrency type to be overridden.
Parameters:
sql - The query for which the cursor has to be created
resultSetType - a result set type; see ResultSet.TYPE_XXX
resultSetConcurrency - a concurrency type; see ResultSet.CONCUR_XXX
Returns:
a new PreparedStatement object containing the pre-compiled SQL statement
Throws:
java.sql.SQLException - if a database access error occurs

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
This is similar to createStatement. We accept both ODBC syntax and Oracle syntax for SQL statements.
Parameters:
sql - The query for which the cursor has to be created
Returns:
a new oracle.jdbc.driver.CallableStatement object
Throws:
java.sql.SQLException - if a database access error occurs

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.SQLException
JDBC 2.0 Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareCall method above, but it allows the default result set type and result set concurrency type to be overridden.
Parameters:
sql - The query for which the cursor has to be created
resultSetType - a result set type; see ResultSet.TYPE_XXX
resultSetConcurrency - a concurrency type; see ResultSet.CONCUR_XXX
Returns:
a new CallableStatement object containing the
Throws:
java.sql.SQLException - if a database access error occurs

prepareCallWithKey

public java.sql.CallableStatement prepareCallWithKey(java.lang.String key)
                                              throws java.sql.SQLException
This is same as prepareCall, except if a Callable Statement with the given KEY exists in the Cache, then the statement is returned AS IT IS when it was closed and cached with this KEY. An object returned from the Cache based on Key will have its state set to "EXPLICIT". If no such Callable Statement is found, then null is returned. Key cannot be null.
Parameters:
key - the key with which it was closed
Returns:
a oracle.jdbc.driver.CallableStatement object
Throws:
java.sql.SQLException - if a database access error occurs

nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException
This is a bogus and quickly done implementation waiting for something better

setAutoCommit

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

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Rollbacks the current transaction. See commit for discussion of how the PreparedStatements, CallableStatement and ResultSets are closed.
See Also:
rollback(), commit()

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
As we do not keep a state in the Java struct we call native method even for isClosed. (The alternative is to test if c_state is 0, but this breaks the information hiding strategy.)

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
We just return a oracle.oci8.DatabaseMetaData object. It has a pointer to the connection.

setReadOnly

public void setReadOnly(boolean value)
                 throws java.sql.SQLException
Sets the Connection as read only if the value is true and the enables the Connection for writing (updat/delete/insert) with the value as false.
Parameters:
true - sets the Connection to be non updatable false sets the Connection to be updatable
Throws:
java.sql.SQLException -  

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
Checking if the Connection is read only or not.
Returns:
true - if the connection is read only false - if the connection is not read only
Throws:
java.sql.SQLException -  

setCatalog

public void setCatalog(java.lang.String catalog)
                throws java.sql.SQLException
We do not support catalogs.

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
We do not support catalogs.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException
We only support dirty reads.

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
We only support dirty reads.

setAutoClose

public void setAutoClose(boolean autoClose)
                  throws java.sql.SQLException
We are always in auto-close mode.

getAutoClose

public boolean getAutoClose()
                     throws java.sql.SQLException
We are always in auto-close mode.

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Return the current warning, if any

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException

trace

public void trace(java.lang.String s)

setDefaultRowPrefetch

public void setDefaultRowPrefetch(int value)
                           throws java.sql.SQLException
Set the value of row prefetch for all statements associated with this connection and created after this value was set.

If this value is not set by the user, only 1 row will be fetched at a time.

All statements created before this API was called will have a row prefetch of 1.

Row prefetching allows the JDBC driver to "fetch" multiple rows in one round-trip to the database. If this value is not set by the user, only 1 row will be fetched at a time.

To use the setDefaultRowPrefetch entrypoint you have to cast the Statement object to the type oracle.jdbc.driver.OracleConnection.

The user can override the row prefetch value set by this oracle.jdbc.driver.OracleConnection entrypoint for individual statements, by calling OracleStatement.setRowPrefetch for those statements.

The row_prefetch will be turned back to 1 automatically by the driver if any of the select-column types is streaming (long data or long raw data). This is overrides any value the user might set. Also, this will be done regardless of wether the streaming columns are read or not.

To use the setDefaultRowPrefetch entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.

See Also:
OracleStatement.setRowPrefetch, getDefaultRowPrefetch

getDefaultRowPrefetch

public int getDefaultRowPrefetch()
Allows the user to retrieve the row prefetch value for the connection.

The row prefetch from the connection is used for all statements associated with this connection. However, the user can also define a different row prefetch value for each statement. This can be done using Oraclestatement.setRowPrefetch, which will override the default value provided from the connection. Therefore, the row prefetch value returned by this getDefaultRowPrefetch entrypoint is valid for statements for which the user has not defined a different row prefetch.

To use the setDefaultRowPrefetch entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.

See Also:
OracleStatement.setRowPrefetch, setDefaultRowPrefetch

setDefaultExecuteBatch

public void setDefaultExecuteBatch(int batch)
                            throws java.sql.SQLException
Set the batch value for executes for all prepared statements belonging to this connection and created after the batch value was set.

All statements created before using this API to set the batch value will have a batch value of 1.

Batching allows the JDBC driver to avoid making one round-trip to the RDBMS to execute a prepared statement every time bind variables change. The driver "batches" multiple executions of the statement with different bind variables. Actual execution normally happens when the number of executions reaches the pre-defined "batch" value. The set of bind variables along with the number of times the statement needs to be executed (equal to "batch"), are sent to the RDBMS in one round-trip.

To use the setDefaultExecuteBatch entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.

The user can override the batch value set by this setDefaultExecuteBatch entrypoint for individual prepared statements, by calling OraclePreparedStatement.setExecuteBatch for those statements.

The default value of batch will be overridden by the driver for a particular statement if that statement has any streaming bind values.

See Also:
OracleStatement.setRowPrefetch, getDefaultRowPrefetch

getDefaultExecuteBatch

public int getDefaultExecuteBatch()
Allows the user to retrieve the batch value for the connection.

The batch value from the connection is used for all prepared statements associated with this connection. However, the user can also define a different batch value for individual prepared statements. This can be done by using OraclePreparedStatement.setExecuteBatch, which will override the default value provided from the connection. Therefore, the row prefetch value returned by this getDefaultExecuteBatch entrypoint is valid for prepared statements for which the user has not defined a different batch value.

To use the getDefaultExecuteBatch entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.

See Also:
OracleStatement.setRowPrefetch, setDefaultRowPrefetch

setRemarksReporting

public void setRemarksReporting(boolean reportRemarks)
Turn on or off the reporting of the REMARKS columns by the getTables and getColumns calls of the DatabaseMetaData interface.

The DatabaseMetaData calls getTables and getColumns are extremely slow if the REMARKS column has to be reported as this necessitates an expensive outer join so by default the JDBC driver does not report the REMARKS columns.

You can turn the reporting of REMARKS on by passing a true argument to this method. You turn it back off by passing a false argument.

You can also control the reporting of REMARKS by passing a property named "remarksReporting" as "true" to the DriverManager.getConnection call.


getRemarksReporting

public boolean getRemarksReporting()
Return true if the DatabaseMetaData calls getTables and getColumns will report the REMARKS column.


setIncludeSynonyms

public void setIncludeSynonyms(boolean synonyms)
Turn on or off retrieval of synonym information in DatabaseMetaData. getColumns.

Similar to setRemarksReporting, getColumns performs extremely slow if information about synonyms has to be included, because it neccessitates an outer join. By default, the JDBC driver will not report information about table columns when you pass a synonym to getColumns.

You can get synonym information by passing true to this method, and turn it off by passing false. You can also control this behavior by passing a property named "includeSynonyms" as "true" to DriverManager.getConnection.


getIncludeSynonyms

public boolean getIncludeSynonyms()
Returns true if DatabaseMetaData.getColumns will report information if a table synonym is passed in, and false otherwise.


setRestrictGetTables

public void setRestrictGetTables(boolean restrict)
Turn on or off the restriction of the returned data in DatabaseMetaData. getTables.

DatabaseMetaData.getTables will return information about all accessible tables, views, and synonyms. There are two issues relating to synonyms which can affect the quality of the returned data:

  1. Public synonyms can exist for tables to which you don't have access. Although the synonym itself is viewable, the underlying table is not.
  2. Synonyms can exist for non-table objects, such as procedures, sequences, Java classes, etc.
As a result of the above issues, getTables can return rows containing objects that are not describable with getColumns, either because they are not accessible (issue 1) or because they are not tables or views (issue 2).

To remedy this, you can restrict the results of getTables to only those tables and views to which you have access. This is done by either passing true to this method, or by passing the "restrictGetTables" property as "true" to the DriverManager.getConnection call. The default behavior is to return information about all synonyms, including those which do not point to accessible tables or views.

Note that getTables can return more than one row for the same object, one for the object itself, and additional rows for any synonyms defined for that object. This is the case regardless of the setting for restrictGetTables.


getRestrictGetTables

public boolean getRestrictGetTables()
Returns true if the information returned by DatabaseMetaData.getTables is restricted, and false otherwise.


setDefaultFixedString

public void setDefaultFixedString(boolean fixedString)
Changes the default setObject(string) behavior for Statements created from this Connection.

By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. This is in accordance with the JDBC specification.

This behavior can be changed for all Statements by passing false to setDefaultFixedString(), or for an individual statement by passing false to OracleStatement.setFixedString().

Parameters:
fixedString - If true, then setObject(x, String) calls will bind with Types.FIXED_CHAR rather than Types.VARCHAR, which will result in blank-padded character comparison semantics.
See Also:
getDefaultFixedString

getDefaultFixedString

public boolean getDefaultFixedString()
Returns the current setObject(string) behavior for Statements created from this Connection.

By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. This is in accordance with the JDBC specification.

This behavior can be changed for all Statements by passing false to setDefaultFixedString(), or for an individual statement by passing false to OracleStatement.setFixedString().

Returns:
The current setting. If true, then setObject(x, String) calls will bind with Types.FIXED_CHAR rather than Types.VARCHAR, which will result in blank-padded character comparison semantics.
See Also:
setDefaultFixedString

needLine

public void needLine()
              throws java.sql.SQLException

holdLine

public void holdLine(oracle.jdbc.internal.OracleStatement stmt)

holdLine

public void holdLine(oracle.jdbc.internal.OracleStatement stmt)

releaseLine

public void releaseLine()

startup

public void startup(java.lang.String startup_str,
                    int mode)
             throws java.sql.SQLException

shutdown

public void shutdown(int mode)
              throws java.sql.SQLException

archive

public void archive(int mode,
                    int aseq,
                    java.lang.String acstext)
             throws java.sql.SQLException

registerSQLType

public void registerSQLType(java.lang.String sql_name,
                            java.lang.String java_class_name)
                     throws java.sql.SQLException
Map accessor methods

registerSQLType

public void registerSQLType(java.lang.String sql_name,
                            java.lang.Class java_class)
                     throws java.sql.SQLException

getSQLType

public java.lang.String getSQLType(java.lang.Object obj)
                            throws java.sql.SQLException

getJavaObject

public java.lang.Object getJavaObject(java.lang.String sql_name)
                               throws java.sql.SQLException

putDescriptor

public void putDescriptor(java.lang.String sql_name,
                          java.lang.Object desc)
                   throws java.sql.SQLException
Store the Object Descriptor for later usage.

getDescriptor

public java.lang.Object getDescriptor(java.lang.String sql_name)
Return the matched StructDescriptor.

putDescriptor

public void putDescriptor(byte[] toid,
                          java.lang.Object desc)
                   throws java.sql.SQLException
Store the Object Descriptor for later usage.

getDescriptor

public java.lang.Object getDescriptor(byte[] toid)
Return the matched StructDescriptor.

getJdbcCsId

public short getJdbcCsId()
                  throws java.sql.SQLException
Obtain the Oracle identifier of the character set used in the JDBC driver.
Returns:
the Oracle identifier of the character set. See oracle.sql.CharacterSet for the set of constants defined for the identifiers.

getDbCsId

public short getDbCsId()
                throws java.sql.SQLException
Obtain the Oracle identifier of the character set used in the database server.
Returns:
the Oracle identifier of the character set. See oracle.sql.CharacterSet for the set of constants defined for the identifiers.

getNCsId

public short getNCsId()
               throws java.sql.SQLException

getStructAttrCsId

public short getStructAttrCsId()
                        throws java.sql.SQLException
Obtain the Oracle identifier of the character set used in STRUCT attributes. Note that TTC always send structure attributes in the database character set.
Returns:
the Oracle identifier of the character set. See oracle.sql.CharacterSet for the set of constants defined for the identifiers.

getStructAttrNCsId

public short getStructAttrNCsId()
                         throws java.sql.SQLException

getTypeMap

public java.util.Map getTypeMap()

setTypeMap

public void setTypeMap(java.util.Map map)

setUsingXAFlag

public void setUsingXAFlag(boolean value)

getUsingXAFlag

public boolean getUsingXAFlag()

setXAErrorFlag

public void setXAErrorFlag(boolean value)

getXAErrorFlag

public boolean getXAErrorFlag()

initUserName

public void initUserName()
                  throws java.sql.SQLException

getUserName

public java.lang.String getUserName()
                             throws java.sql.SQLException

setHoldability

public void setHoldability(int holdability)
                    throws java.sql.SQLException
JDBC 3.0 Changes the holdability of ResultSet objects created using this Connection object to the given holdability.
Parameters:
holdability - a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Throws:
java.sql.SQLException - if a database access occurs, the given parameter is not a ResultSet constant indicating holdability, or the given holdability is not supported
Since:
9.0.2
See Also:
getHoldability(), ResultSet

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
JDBC 3.0 Retrieves the current holdability of ResultSet objects created using this Connection object.
Returns:
the holdability, one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Throws:
java.sql.SQLException - if a database access occurs
Since:
9.0.2
See Also:
setHoldability(int), ResultSet

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.SQLException

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.SQLException
JDBC 3.0 Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.
Parameters:
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
java.sql.SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
Since:
9.0.2
See Also:
ResultSet

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.SQLException
JDBC 3.0 Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.

This method is the same as the prepareStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.

Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
java.sql.SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
Since:
9.0.2
See Also:
ResultSet

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.SQLException
JDBC 3.0 Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and holdability to be overridden.
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain on or more ? parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
java.sql.SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
Since:
9.0.2
See Also:
ResultSet

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)
                                            throws java.sql.SQLException
JDBC 3.0 Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. The given constant tells the driver whether it should make auto-generated keys available for retrieval. This parameter is ignored if the SQL statement is not an INSERT statement.

Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders
autoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; one of the following Statement constants:
autoGeneratedKeys - a flag indicating that auto-generated keys should be returned, one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS.
Returns:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys
Throws:
java.sql.SQLException - if a database access error occurs or the given parameter is not a Statement constant indicating whether auto-generated keys should be returned
Since:
9.0.2

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] columnIndexes)
                                            throws java.sql.SQLException
JDBC 3.0 Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. This array is ignored if the SQL statement is not an INSERT statement.

An SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders
columnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row or rows
Returns:
a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated keys designated by the given array of column indexes
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.SQLException
JDBC 3.0 Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array contains the names of the columns in the target table that contain the auto-generated keys that should be returned. This array is ignored if the SQL statement is not an INSERT statement.

An SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders
columnNames - an array of column names indicating the columns that should be returned from the inserted row or rows
Returns:
a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated keys designated by the given array of column names
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

oracleSetSavepoint

public OracleSavepoint oracleSetSavepoint()
                                   throws java.sql.SQLException
Oracle extension Creates an unnamed savepoint in the current transaction and returns the new oracle.jdbc.OracleSavepoint object that represents it.
Returns:
the new oracle.jdbc.OracleSavepoint object
Throws:
java.sql.SQLException - if a database access error occurs or this Connection object is currently in auto-commit mode
Since:
9.0.2
See Also:
OracleSavepoint

oracleSetSavepoint

public OracleSavepoint oracleSetSavepoint(java.lang.String name)
                                   throws java.sql.SQLException
Oracle extension Creates a savepoint with the given name in the current transaction and returns the new oracle.jdbc.OracleSavepoint object that represents it.
Parameters:
name - a String containing the name of the savepoint
Returns:
the new oracle.jdbc.OracleSavepoint object
Throws:
java.sql.SQLException - if a database access error occurs or this Connection object is currently in auto-commit mode
Since:
9.0.2
See Also:
OracleSavepoint

oracleRollback

public void oracleRollback(OracleSavepoint savepoint)
                    throws java.sql.SQLException
Oracle extension Undoes all the changes made after the given oracle.jdbc.OracleSavepoint object was set.

This method should be used only when auto-commit has been disabled.

Parameters:
savepoint - the oracle.jdbc.OracleSavepoint object to roll back to
Throws:
java.sql.SQLException - if a database access error occurs, the oracle.jdbc.OracleSavepoint object is no longer valid, or this Connection object is currently in auto-commit mode
Since:
9.0.2
See Also:
OracleSavepoint

oracleReleaseSavepoint

public void oracleReleaseSavepoint(OracleSavepoint savepoint)
                            throws java.sql.SQLException
Oracle extension Removes the given oracle.jdbc.OracleSavepoint object from the current transaction. Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.
Parameters:
savepoint - the oracle.jdbc.OracleSavepoint object to be removed
Throws:
java.sql.SQLException - if a database access error occurs or the given oracle.jdbc.OracleSavepoint object is not a valid savepoint in the current transaction
Since:
9.0.2
See Also:
OracleSavepoint

getClientData

public java.lang.Object getClientData(java.lang.Object key)
Obtain the client data value associated with a key.
Parameters:
key - key whose associated value is to be returned.
Returns:
value associated with the specified key, or null if there is no value for this key.
Throws:
NullPointerException - if the specified key is null.

setClientData

public java.lang.Object setClientData(java.lang.Object key,
                                      java.lang.Object value)
Store a piece client data and associate it with the specified key. Neither the key nor the value can be null. If the specified key already existed, the old value is replaced.
Parameters:
key - key with which the specified client data value is to be associated.
value - client data value to be associated with the specified key.
Returns:
previous client data value associated with specified key, or null if there was no previous association.
Throws:
NullPointerException - if the specified key or value is null.

removeClientData

public java.lang.Object removeClientData(java.lang.Object key)
Remove the specified key and any associated client data.
Parameters:
key - key to be removed along with its associated value
Returns:
client data value being removed, or null if there was no data found.
Throws:
NullPointerException - if the specified key is null.

createBlobDBAccess

public oracle.jdbc.driver.BlobDBAccess createBlobDBAccess()
                                                   throws java.sql.SQLException

createClobDBAccess

public oracle.jdbc.driver.ClobDBAccess createClobDBAccess()
                                                   throws java.sql.SQLException

createBfileDBAccess

public oracle.jdbc.driver.BfileDBAccess createBfileDBAccess()
                                                     throws java.sql.SQLException

setStmtCacheSize

public void setStmtCacheSize(int size)
                      throws java.sql.SQLException
Deprecated. Use setStatementCacheSize instead.

setStmtCacheSize

public void setStmtCacheSize(int size,
                             boolean clearMetaData)
                      throws java.sql.SQLException
Deprecated. Use setStatementCacheSize instead.

getStmtCacheSize

public int getStmtCacheSize()
Deprecated. Use getStatementCacheSize instead.

setStatementCacheSize

public void setStatementCacheSize(int size)
                           throws java.sql.SQLException
setStatementCacheSize Specifies the size of the size of the application cache (which will be used by both implicit and explicit caching).
Parameters:
size - Requested size of the cache. If the existing cache size is less than size, statements will be purged to reduce the size.
Throws:
java.sql.SQLException - if size < 0, or if called on a logical connection.

getStatementCacheSize

public int getStatementCacheSize()
                          throws java.sql.SQLException
getStatementCacheSize Returns the current size of the application cache. This is valid on both physical and logical connections. If the statement cache has not been initialized with setStatementCacheSize(), then CACHE_SIZE_NOT_SET is returned.

setImplicitCachingEnabled

public void setImplicitCachingEnabled(boolean cache)
                               throws java.sql.SQLException
setImplicitCachingEnabled Enables or disables the implicit cache. Note that this is independent of the cache size, set with setStatmentCacheSize().
Parameters:
cache - If true, then implicit caching will be enabled. If false, then any existing statements will be purged and the implicit cache will be disabled.
Throws:
java.sql.SQLException - if called on a logical connection, or if the cache size has not been set with setStatementCacheSize().

getImplicitCachingEnabled

public boolean getImplicitCachingEnabled()
                                  throws java.sql.SQLException
getImplicitCachingEnabled Returns true if the implicit cache is currently enabled, false otherwise. This method is valid on both logical and physical connections.
Throws:
java.sql.SQLException - if the cache size has not been set with setStatementCacheSize().

setExplicitCachingEnabled

public void setExplicitCachingEnabled(boolean cache)
                               throws java.sql.SQLException
setExplicitCachingEnabled Enables or disables the explicit cache. Note that this is independent of the cache size, set with setStatmentCacheSize().
Parameters:
cache - If true, then explicit caching will be enabled. If false, then any existing statements will be purged and the explicit cache will be disabled.
Throws:
java.sql.SQLException - if called on a logical connection, or if the cache size has not been set with setStatementCacheSize().

getExplicitCachingEnabled

public boolean getExplicitCachingEnabled()
                                  throws java.sql.SQLException
getExplicitCachingEnabled Returns true if the explicit cache is currently enabled, false otherwise. This method is valid on both logical and physical connections.
Throws:
java.sql.SQLException - if the cache size has not been set with setStatementCacheSize().

purgeImplicitCache

public void purgeImplicitCache()
                        throws java.sql.SQLException
purgeImplicitCache Removes all existing statements from the implicit cache, after which it will be empty. This method does not affect the size of the application cache, nor the enabled/disabled status. If the cache size has not been set, no error is thrown, since there is already nothing in the implicit cache.

purgeExplicitCache

public void purgeExplicitCache()
                        throws java.sql.SQLException
purgeExplicitCache Removes all existing statements from the explicit cache, after which it will be empty. This method does not affect the size of the application cache, nor the enabled/disabled status. If the cache size has not been set, no error is thrown, since there is already nothing in the explicit cache.

getStatementWithKey

public java.sql.PreparedStatement getStatementWithKey(java.lang.String key)
                                               throws java.sql.SQLException
getStatementWithKey Searches the explicit cache for a match on key. If found, the statement is returned, with the paramater and define metadata identical to the last usage. If a CallableStatement is found (instead of a PreparedStatement, ORA-17125 is raised. If no match is found, or if explicit caching is not enabled, null is returned.
Parameters:
key - Specified key to search for

getCallWithKey

public java.sql.CallableStatement getCallWithKey(java.lang.String key)
                                          throws java.sql.SQLException
getCallWithKey Searches the explicit cache for a match on key. If found, the statement is returned, with the paramater and define metadata identical to the last usage. If a PreparedStatement is found (instead of a CallableStatement, ORA-17125 is raised. If no match is found, or if explicit caching is not enabled, null is returned.
Parameters:
key - Specified key to search for

cacheImplicitStatement

public void cacheImplicitStatement(OraclePreparedStatement stmt,
                                   java.lang.String sql,
                                   int statementType,
                                   int scrollType)
                            throws java.sql.SQLException
cacheImplicitStatement Adds the supplied statement to the implicit cache, using the supplied sql string, statement type, and scroll type.

cacheExplicitStatement

public void cacheExplicitStatement(OraclePreparedStatement stmt,
                                   java.lang.String key)
                            throws java.sql.SQLException
cacheExplicitStatement Adds the supplied statement to the explicit cache with the supplied key.
Throws:
java.sql.SQLException - if the cache size has not been set with setStatementCacheSize().

isStatementCacheInitialized

public boolean isStatementCacheInitialized()

setDefaultAutoRefetch

public void setDefaultAutoRefetch(boolean autoRefetch)
                           throws java.sql.SQLException
Oracle extension. Set the default state of ResultSet's auto-refetch mode of the connection. If a ResultSet is in auto-refetch mode, then it automatically refetches the column values during updateRow(). Otherwise, the column values in the ResultSet are the same as the value from the updateXXX() calls which may not be in sync with the database column values if a database trigger is enabled to modify the column values. Disable auto-refetch improves performance by avoiding one database round-trip druing the updateRow() call. By default, the connection's default auto-refetech value is true.
Parameters:
autoRefetch - true enables auto-refetch; false disables auto-refetch.
Throws:
java.sql.SQLException - if a database access error occurs
Since:
8.1.7
See Also:
OracleStatement.setAutoRefetch(boolean), OracleResultSet.setAutoRefetch(boolean)

getDefaultAutoRefetch

public boolean getDefaultAutoRefetch()
                              throws java.sql.SQLException
Oracle extension. Gets the default auto-refetch state of this connection.
Returns:
the current state of auot-refetch mode
Throws:
java.sql.SQLException - if a database access error occurs
Since:
8.1.7
See Also:
setDefaultAutoRefetch(boolean)

getDatabaseProductVersion

public java.lang.String getDatabaseProductVersion()
                                           throws java.sql.SQLException
What's the version of this database product?
Returns:
database version

getReportRemarks

public boolean getReportRemarks()

getVersionNumber

public short getVersionNumber()
                       throws java.sql.SQLException

registerCloseCallback

public void registerCloseCallback(oracle.jdbc.driver.OracleCloseCallback occ,
                                  java.lang.Object privData)

setCreateStatementAsRefCursor

public void setCreateStatementAsRefCursor(boolean value)
When this is set to true, any new statements created from this connection will be created as a REF CURSOR. Only resultsets obtained from statements that are created as REF CURSORS can be returned from a Java Stored Procedure. This feture is supported by the server-side internal driver only, and is no-op in all other JDBC drivers. Default value is false. To use the setCreateStatementAsRefCursor entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.


getCreateStatementAsRefCursor

public boolean getCreateStatementAsRefCursor()
Retrieve the current setting of the createStatementAsRefCursor flag.
Returns:
current value of createStatementAsRefCursor flag To use the getCreateStatementAsRefCursor entrypoint you have to cast the Connection object to the type oracle.jdbc.driver.OracleConnection.

See Also:
setCreateStatementAsRefCursor(boolean)

pingDatabase

public int pingDatabase(int timeOut)
                 throws java.sql.SQLException
ping Database and return status of connection

clearClientIdentifier

public void clearClientIdentifier(java.lang.String clientId)
                           throws java.sql.SQLException
Clear the client identifier for this session.
Parameters:
clientId - to be cleared
Throws:
java.sql.SQLException - if a database access error occurs clearing

setClientIdentifier

public void setClientIdentifier(java.lang.String clientId)
                         throws java.sql.SQLException
Set the client identifier for this session.
Parameters:
clientId - to be set
Throws:
java.sql.SQLException - if a database access error occurs setting

assertComplete

public void assertComplete()
                    throws java.sql.SQLException
Deprecated.  
Wait until all Ultra method calls to this connection have completed, either by returning or throwing an exception. This method may throw an exception if one of the calls caused an error on the server. Is a no-op for the Thin, OCI, and Server Internal drivers.
Throws:
java.sql.SQLException -  

getSynchronousMode

public boolean getSynchronousMode()
Deprecated.  
Return the value of the synchronous mode switch for this connection. When using the Ultra driver may return true or false. If true, then this connection is operating in synchronous mode and exceptions will be thrown by the methods that casue them. If false, then running in asynchronous mode and exceptions may be thrown at some time after the method that caused them returns. See JDBC Users Guide for more details. Asynchronous mode is much faster. In the Thin, OCI, and Server Internal drivers, always returns true.
Returns:
boolean true if synchronous mode, false if asynchronous.

setSynchronousMode

public void setSynchronousMode(boolean isSynchronous)
Deprecated.  
Set the value of the synchronous mode switch for this connection. When using the Ultra driver may be either true or false. If true, then this connection will operate in synchronous mode and exceptions will be thrown by the methods that casue them. If false, then will run in asynchronous mode and exceptions may be thrown at some time after the method that caused them returns. See JDBC Users Guide for more details. Asynchronous mode is much faster. In the Thin, OCI, and Server Internal drivers, value is ignored.
Parameters:
isSynchronous - true if should run synchronously, false if asynchronously.

registerApiDescription

public void registerApiDescription(java.lang.String apiName,
                                   short major,
                                   short minor,
                                   java.lang.String className)
Deprecated.  
When used in the Ultra driver, registers an ApiDescription for use in a Jolt connection. See Jolt Appendix of JDBC Users Guide for more details. A single ApiDescription class can be registered for multiple versions and generic api names. The last ApiDescription class registered for a given api name and version replaces any others. Ignored by the Thin, OCI, and Server Internal drivers.
Parameters:
apiName - a String that names the generic api that this ApiDescription supports
major - a short that specifies the major version number that this ApiDescription supports
minor - a short that specifies the minor version number that this ApiDescription supports
className - a String that is the fully qualified class name of the ApiDescription class

openJoltConnection

public java.lang.Object openJoltConnection(java.lang.String apiName,
                                           short major,
                                           short minor)
Deprecated.  
When used with the Ultra driver, opens a Jolt connection with the given generic api name and the highest version supported by both parties that is less than or equal to the version provided. If there is no common version or the other party does not support that api name, then returns null. You must cast the result to an ApiDescription. See Jolt Appendix of JDBC Users Guide for more details. When used with the Thin, OCI, or Server Internal drivers, always returns null.
Parameters:
apiName - a String that names the generic api to be used
major - the major version number of the highest version to be used
minor - the minor version number of the highest version to be used
Returns:
an ApiDescription that was regisetered with apiName and has the highest version number that is also supported by the server and is less than major.minor or null if none.

setSessionTimeZone

public void setSessionTimeZone(java.lang.String regionName)
                        throws java.sql.SQLException
Set the session time zone.

This method is used to set the session time zone. This method must be invoked before accessing any TIMESTAMP WITH LOCAL TIME ZONE data. Upon invocation of this method, the Jdbc driver sets the session timezone of the connection adnd saves the session timezone so that any TSLTZ data accessed via Jdbc are adjusted using the session timezone.

Parameters:
regionName - Oracle session time zone region name.
Throws:
java.sql.SQLException - if an error occurred.
Since:
9i

getSessionTimeZone

public java.lang.String getSessionTimeZone()
Obtain Oracle session time zone region name.
Returns:
Oracle session time zone region name.
Since:
9i

setAccumulateBatchResult

public void setAccumulateBatchResult(boolean val)
Set if the batching type for the connection
Parameters:
true - if the batching is of type 9i false to turn off the 9i type of batching
Since:
9i

isAccumulateBatchResult

public boolean isAccumulateBatchResult()
Check the batching type of the connection
Returns:
true if the batching is of type 9i (accumulating premature batch flushing). false if the batching is not of type 9i
Since:
9i

unwrapCompletely

public static OracleConnection unwrapCompletely(OracleConnection wrappedConnection)
This method will take an oracle.jdbc.OracleConnection object as an argument and repeatedly call the unwrap method until it has reached null. It will return the last non-null object.

setWrapper

public void setWrapper(OracleConnection w)

unwrap

public OracleConnection unwrap()

getWrapper

public OracleConnection getWrapper()