Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

oracle.mail.sdk.esmail
Class OracleDBPool

java.lang.Object
  |
  +--oracle.mail.sdk.esmail.OracleDBPool

public class OracleDBPool
extends java.lang.Object

This is a jdbc connection pool used by the javamail service provider. A pool of connections may be created by a calling application. Otherwise the pooled connections are created by default. Internally, the OracleConnectionCache class is used to manage connection pools. The user may choose the type of connection pooling mechanism(fixed, dynamic, fixed return null) by specifying the scheme. To use the defaults, set the values to -1.


Constructor Summary
OracleDBPool()

Method Summary
static byte[] _doEncrypt(java.lang.String db_password)
static java.sql.Connection getDBConn(DBConnectInfo aConnectInfo)
Return a connection from the connection pool.
static java.sql.Connection getDBConn(OESContext usrContext)
getDBConn - Overloaded method to use OESContext to return connection from the pool instead of the OESLoginContext.
static java.sql.Connection getDBConn(OESLoginContext usrContext)
User method to return connection from pool.
static void initDBPool(OESContext appContext, int max, int min, int incr, int stmtCacheSize, int cacheScheme)
initDBPool User method to set connection pool.
static void initDBPool(OESContext appContext, java.lang.String installationName, java.lang.String globalDBName, int max, int min, int incr, int stmtCacheSize, int cacheScheme)
User method to set connection pool.
static void initDBPool(OESLoginContext appContext, int max, int min, int incr, int stmtCacheSize, int cacheScheme)
User method to set connection pool.
static void initDBPool(java.lang.String key, java.lang.String dbServer, int dbPort, java.lang.String dbUser, java.lang.String db_password, java.lang.String connectString, java.lang.String tnsEntry)
initDBPool Read the connpool_min_limit, connpool_max_limit and connpool_increment properties.
static void releaseDBConn(java.sql.Connection dbConn)
releaseDBConn - To be used to release a connection back into the pool.
static void setDebug(boolean value)
Print debug statements - useful to see connection cache and active connection size.
static void setEncrypt(boolean value)
static void setTiming(boolean value)

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

Constructor Detail

OracleDBPool

public OracleDBPool()

Method Detail

setDebug

public static void setDebug(boolean value)

Print debug statements - useful to see connection cache and active connection size.


setEncrypt

public static void setEncrypt(boolean value)

setTiming

public static void setTiming(boolean value)

initDBPool

public static void initDBPool(OESLoginContext appContext,
                              int max,
                              int min,
                              int incr,
                              int stmtCacheSize,
                              int cacheScheme)

User method to set connection pool. The default values for the pool setup are max = 10, min = 1, increment = 1, statement cache size = 20, cache scheme = OracleConnectionCacheImpl.FIXED_WAIT_SCHEME.

Note : To use default values, pass in -1.

Parameters:
appContext - Application's authenticated OESLoginContext
max - Connection Pool max limit
min - Connection Pool min limit
incr - Increment
stmtCache - Statement cache size
cacheScheme - OracleConnectionCacheImpl.FIXED_WAIT_SCHEME, OracleConnectionCacheImpl.DYNAMIC_SCHEME, OracleConnectionCacheImpl.FIXED_RETURN_NULL_SCHEME

initDBPool

public static void initDBPool(OESContext appContext,
                              java.lang.String installationName,
                              java.lang.String globalDBName,
                              int max,
                              int min,
                              int incr,
                              int stmtCacheSize,
                              int cacheScheme)

User method to set connection pool. The default values for the pool setup are max = 10, min = 1, increment = 1, statement cache size = 20, cache scheme = OracleConnectionCacheImpl.FIXED_WAIT_SCHEME.

Note : To use default values, pass in -1.

Parameters:
appContext - Application's authenticated OESContext
max - Connection Pool max limit
min - Connection Pool min limit
incr - Increment
stmtCache - Statement cache size
cacheScheme - OracleConnectionCacheImpl.FIXED_WAIT_SCHEME, OracleConnectionCacheImpl.DYNAMIC_SCHEME, OracleConnectionCacheImpl.FIXED_RETURN_NULL_SCHEME

getDBConn

public static java.sql.Connection getDBConn(OESLoginContext usrContext)
User method to return connection from pool. If no pooled connection exists to the mailstore, a pool with default values is set up.
Parameters:
usrContext - An authenticated user's login context.
Returns:
Connection

initDBPool

public static void initDBPool(OESContext appContext,
                              int max,
                              int min,
                              int incr,
                              int stmtCacheSize,
                              int cacheScheme)

initDBPool User method to set connection pool. The default values for the pool setup are max = 10, min = 1, increment = 1, statement cache size = 20, cache scheme = OracleConnectionCacheImpl.FIXED_WAIT_SCHEME.

Note: To use default values, pass in -1.

Parameters:
appContext - Application's authenticated OESContext
max - Connection Pool max limit
min - Connection Pool min limit
incr - Increment
stmtCache - Statement cache size
cacheScheme - OracleConnectionCacheImpl.FIXED_WAIT_SCHEME, OracleConnectionCacheImpl.DYNAMIC_SCHEME, OracleConnectionCacheImpl.FIXED_RETURN_NULL_SCHEME

getDBConn

public static java.sql.Connection getDBConn(OESContext usrContext)

getDBConn - Overloaded method to use OESContext to return connection from the pool instead of the OESLoginContext.

Parameters:
OESContext - user OESContext
Returns:
Connection

initDBPool

public static void initDBPool(java.lang.String key,
                              java.lang.String dbServer,
                              int dbPort,
                              java.lang.String dbUser,
                              java.lang.String db_password,
                              java.lang.String connectString,
                              java.lang.String tnsEntry)

initDBPool Read the connpool_min_limit, connpool_max_limit and connpool_increment properties. Otherwise, set default values. This method is for internal api(s) only and may not be supported in subsequent releases.


getDBConn

public static java.sql.Connection getDBConn(DBConnectInfo aConnectInfo)

Return a connection from the connection pool. The key and connect string is used to obtain a connection from the connection pool.


releaseDBConn

public static void releaseDBConn(java.sql.Connection dbConn)

releaseDBConn - To be used to release a connection back into the pool.

Parameters:
Connection - connection object to close.

_doEncrypt

public static byte[] _doEncrypt(java.lang.String db_password)
                         throws java.lang.Exception

Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

Copyright © 1988, 2005, Oracle. All rights reserved.