Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.5)

Part Number E13941-05

weblogic.jdbc.extensions
Interface WLConnection


public interface WLConnection

Contains methods to interact with the Statement Cache


Method Summary
 boolean clearCallableStatement(String sql)
          Clears a callable statement from the Statement Cache
 boolean clearCallableStatement(String sql, int resType, int resConcurrency)
          Clears a callable statement from the Statement Cache
 boolean clearPreparedStatement(String sql)
          Clears a prepared statement from the Statement Cache
 boolean clearPreparedStatement(String sql, int resType, int resConcurrency)
          Clears a prepared statement from the Statement Cache
 void clearStatementCache()
          Clears the statement cache.
 String getPoolName()
          Returns the name of the connection pool to which this connection belongs to.
 Connection getVendorConnection()
          Returns the underlying physical connection (the vendor connection) from a pooled database connection (a logical connection).
 Connection getVendorConnectionSafe()
          Returns the underlying physical connection (the vendor connection) from a pooled database connection (a logical connection).
 boolean isValid()
          This method equals to isValid(15).
 boolean isValid(int timeout)
          Returns true if connection is still valid.
 void setFailed()
          Force this connection to be destroyed by connection pool
 

Method Detail

clearStatementCache

void clearStatementCache()
                         throws SQLException
Clears the statement cache.

Throws:
SQLException - - if a database access error occurs

getVendorConnection

Connection getVendorConnection()
                               throws SQLException
Returns the underlying physical connection (the vendor connection) from a pooled database connection (a logical connection).

Returns:
java.sql.Connection
Throws:
SQLException - - if a database access error occurs

clearCallableStatement

boolean clearCallableStatement(String sql)
                               throws SQLException
Clears a callable statement from the Statement Cache

Parameters:
sql - - an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string.
Returns:
true - statement found and removed from cache
false - statement not found in cache. This is not always an erroneous condition as it can happen if statement caching is diabled, or the statement got ejected from the cache to make space for another.
Throws:
SQLException - - if a database access error occurs

clearCallableStatement

boolean clearCallableStatement(String sql,
                               int resType,
                               int resConcurrency)
                               throws SQLException
Clears a callable statement from the Statement Cache

Parameters:
sql - - an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string.
resSetType - - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Returns:
true - statement found and removed from cache
false - statement not found in cache. This is not always an erroneous condition as it can happen if statement caching is diabled, or the statement got ejected from the cache to make space for another.
Throws:
SQLException - - if a database access error occurs

clearPreparedStatement

boolean clearPreparedStatement(String sql)
                               throws SQLException
Clears a prepared statement from the Statement Cache

Parameters:
sql - - an SQL statement that may contain one or more '?' IN parameter placeholders
Returns:
true - statement found and removed from cache
false - statement not found in cache. This is not always an erroneous condition as it can happen if statement caching is diabled, or the statement got ejected from the cache to make space for another.
Throws:
SQLException - - if a database access error occurs

clearPreparedStatement

boolean clearPreparedStatement(String sql,
                               int resType,
                               int resConcurrency)
                               throws SQLException
Clears a prepared statement from the Statement Cache

Parameters:
sql - - an SQL statement that may contain one or more '?' IN parameter placeholders
resSetType - - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Returns:
true - statement found and removed from cache
false - statement not found in cache. This is not always an erroneous condition as it can happen if statement caching is diabled, or the statement got ejected from the cache to make space for another.
Throws:
SQLException - - if a database access error occurs

getPoolName

String getPoolName()
Returns the name of the connection pool to which this connection belongs to.


setFailed

void setFailed()
               throws SQLException
Force this connection to be destroyed by connection pool

Throws:
SQLException - - if a connection pool error happen

isValid

boolean isValid(int timeout)
                throws SQLException
Returns true if connection is still valid. Please refer to java.sql.Connection.isValid(int timeout) for more information.

Parameters:
timeout - - The time in seconds to wait for the database operation used to validate the connection to complete. A value of 0 indicates a timeout is not applied to the database operation.
Returns:
true if the connection is valid, false otherwise
Throws:
SQLException - - if the value supplied for timeout is less then 0

isValid

boolean isValid()
                throws SQLException
This method equals to isValid(15).

Throws:
SQLException

getVendorConnectionSafe

Connection getVendorConnectionSafe()
                                   throws SQLException
Returns the underlying physical connection (the vendor connection) from a pooled database connection (a logical connection). When the connection is closed, it is returned to the pool, independent of the setting of Remove Infected Connections Enabled.

Returns:
java.sql.Connection
Throws:
SQLException - - if a database access error occurs

Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.5)

Part Number E13941-05