com.ibm.as400.access
Class AS400JDBCConnectionPoolDataSource

java.lang.Object
  extended by com.ibm.as400.access.AS400JDBCDataSource
      extended by com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
All Implemented Interfaces:
Serializable, Cloneable, Wrapper, Referenceable, CommonDataSource, ConnectionPoolDataSource, DataSource

public class AS400JDBCConnectionPoolDataSource
extends AS400JDBCDataSource
implements ConnectionPoolDataSource, Referenceable, Serializable

The AS400JDBCConnectionPoolDataSource class represents a factory for AS400PooledConnection objects.

The following is an example that creates an AS400JDBCConnectionPoolDataSource object that can be used to cache JDBC connections.

// Create a data source for making the connection. AS400JDBCConnectionPoolDataSource dataSource = new AS400JDBCConnectionPoolDataSource("myAS400"); datasource.setUser("myUser"); datasource.setPassword("MYPWD"); // Get the PooledConnection. PooledConnection pooledConnection = datasource.getPooledConnection();

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class com.ibm.as400.access.AS400JDBCDataSource
CONCURRENTACCESS_NOT_SET, CONCURRENTACCESS_SKIP_LOCKS, CONCURRENTACCESS_USE_CURRENTLY_COMMITTED, CONCURRENTACCESS_WAIT_FOR_OUTCOME, MAX_STORAGE_LIMIT, SERVER_TRACE_DEBUG_SERVER_JOB, SERVER_TRACE_SAVE_SERVER_JOBLOG, SERVER_TRACE_SAVE_SQL_INFORMATION, SERVER_TRACE_START_DATABASE_MONITOR, SERVER_TRACE_TRACE_SERVER_JOB
 
Constructor Summary
Constructor and Description
AS400JDBCConnectionPoolDataSource()
          Constructs a default AS400JDBCConnectionPoolDataSource object.
AS400JDBCConnectionPoolDataSource(String serverName)
          Constructs an AS400JDBCConnectionPoolDataSource with the specified serverName.
AS400JDBCConnectionPoolDataSource(String serverName, String user, String password)
          Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information.
AS400JDBCConnectionPoolDataSource(String serverName, String user, String password, String keyRingName, String keyRingPassword)
          Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information to use for SSL communications with the system.
 
Method Summary
Modifier and Type Method and Description
 PooledConnection getPooledConnection()
          Returns a pooled connection that is connected to the IBM i system.
 PooledConnection getPooledConnection(String user, String password)
          Returns a pooled connection that is connected to the IBM i system.
 Reference getReference()
          Returns the Reference object for the data source object.
 
Methods inherited from class com.ibm.as400.access.AS400JDBCDataSource
addPropertyChangeListener, clone, getAccess, getBehaviorOverride, getBidiStringType, getBlockCriteria, getBlockSize, getConcurrentAccessResolution, getConnection, getConnection, getCursorSensitivity, getDatabaseName, getDataSourceName, getDateFormat, getDateSeparator, getDecfloatRoundingMode, getDecimalSeparator, getDescription, getDriver, getErrors, getIgnoreWarnings, getKeepAlive, getLibraries, getLobThreshold, getLoginTimeout, getLogWriter, getMaximumPrecision, getMaximumScale, getMetadataSource, getMetaDataSource, getMinimumDivideScale, getNaming, getPackage, getPackageCcsid, getPackageCCSID, getPackageCriteria, getPackageError, getPackageLibrary, getProxyServer, getQaqqinilib, getQaqqiniLibrary, getQueryOptimizeGoal, getQueryStorageLimit, getReceiveBufferSize, getRemarks, getSecondaryUrl, getSecondaryURL, getSendBufferSize, getServerName, getServerTrace, getServerTraceCategories, getSocketTimeout, getSoLinger, getSort, getSortLanguage, getSortTable, getSortWeight, getSoTimeout, getTcpNoDelay, getTimeFormat, getTimeSeparator, getToolboxTrace, getToolboxTraceCategory, getTransactionIsolation, getTranslateHex, getUser, getXALooselyCoupledSupport, isAutoCommit, isAutocommitException, isBidiImplicitReordering, isBidiNumericOrdering, isBigDecimal, isCursorHold, isDataCompression, isDataTruncation, isExtendedDynamic, isExtendedMetadata, isExtendedMetaData, isFullOpen, isHoldInputLocators, isHoldStatements, isJvm16Synchronize, isLazyClose, isPackageAdd, isPackageCache, isPackageClear, isPrefetch, isPrompt, isRollbackCursorHold, isSavePasswordWhenSerialized, isSecure, isSecureCurrentUser, isThreadUsed, isTrace, isTranslateBinary, isTranslateBoolean, isTrueAutocommit, isTrueAutoCommit, isVariableFieldCompression, removePropertyChangeListener, setAccess, setAutoCommit, setAutocommitException, setBehaviorOverride, setBidiImplicitReordering, setBidiNumericOrdering, setBidiStringType, setBigDecimal, setBlockCriteria, setBlockSize, setConcurrentAccessResolution, setCursorHold, setCursorSensitivity, setDatabaseName, setDataCompression, setDataSourceName, setDataTruncation, setDateFormat, setDateSeparator, setDecfloatRoundingMode, setDecimalSeparator, setDescription, setDriver, setErrors, setExtendedDynamic, setExtendedMetadata, setExtendedMetaData, setFullOpen, setHoldInputLocators, setHoldStatements, setIgnoreWarnings, setJvm16Synchronize, setKeepAlive, setLazyClose, setLibraries, setLobThreshold, setLoginTimeout, setLogWriter, setMaximumPrecision, setMaximumScale, setMetadataSource, setMetaDataSource, setMinimumDivideScale, setNaming, setPackage, setPackageAdd, setPackageCache, setPackageCcsid, setPackageCCSID, setPackageClear, setPackageCriteria, setPackageError, setPackageLibrary, setPassword, setPrefetch, setPrompt, setProperties, setProperties, setProxyServer, setQaqqinilib, setQaqqiniLibrary, setQueryOptimizeGoal, setQueryStorageLimit, setReceiveBufferSize, setRemarks, setRollbackCursorHold, setSavePasswordWhenSerialized, setSecondaryUrl, setSecondaryURL, setSecure, setSecureCurrentUser, setSendBufferSize, setServerName, setServerTrace, setServerTraceCategories, setSocketTimeout, setSoLinger, setSort, setSortLanguage, setSortTable, setSortWeight, setSoTimeout, setTcpNoDelay, setThreadUsed, setTimeFormat, setTimeSeparator, setToolboxTrace, setToolboxTraceCategory, setTrace, setTransactionIsolation, setTranslateBinary, setTranslateBoolean, setTranslateHex, setTrueAutocommit, setTrueAutoCommit, setUser, setVariableFieldCompression, setXALooselyCoupledSupport, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

AS400JDBCConnectionPoolDataSource

public AS400JDBCConnectionPoolDataSource()
Constructs a default AS400JDBCConnectionPoolDataSource object.


AS400JDBCConnectionPoolDataSource

public AS400JDBCConnectionPoolDataSource(String serverName)
Constructs an AS400JDBCConnectionPoolDataSource with the specified serverName.

Parameters:
serverName - The IBM i system name.

AS400JDBCConnectionPoolDataSource

public AS400JDBCConnectionPoolDataSource(String serverName,
                                         String user,
                                         String password)
Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information.

Parameters:
serverName - The IBM i system name.
user - The user id.
password - The password.

AS400JDBCConnectionPoolDataSource

public AS400JDBCConnectionPoolDataSource(String serverName,
                                         String user,
                                         String password,
                                         String keyRingName,
                                         String keyRingPassword)
Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information to use for SSL communications with the system.

Parameters:
serverName - The IBM i system name.
user - The user id.
password - The password.
keyRingName - The key ring class name to be used for SSL communications with the system.
keyRingPassword - The password for the key ring class to be used for SSL communications with the system.
Method Detail

getPooledConnection

public PooledConnection getPooledConnection()
                                     throws SQLException
Returns a pooled connection that is connected to the IBM i system.

Specified by:
getPooledConnection in interface ConnectionPoolDataSource
Returns:
A pooled connection.
Throws:
SQLException - If a database error occurs.

getPooledConnection

public PooledConnection getPooledConnection(String user,
                                            String password)
                                     throws SQLException
Returns a pooled connection that is connected to the IBM i system.

Specified by:
getPooledConnection in interface ConnectionPoolDataSource
Parameters:
user - The userid for the connection.
password - The password for the connection.
Returns:
A pooled connection.
Throws:
SQLException - If a database error occurs.

getReference

public Reference getReference()
                       throws NamingException
Returns the Reference object for the data source object. This is used by JNDI when bound in a JNDI naming service. Contains the information necessary to reconstruct the data source object when it is later retrieved from JNDI via an object factory.

Specified by:
getReference in interface Referenceable
Overrides:
getReference in class AS400JDBCDataSource
Returns:
A Reference object for the data source object.
Throws:
NamingException - If a naming error occurs resolving the object.