com.ibm.as400.access
Class AS400JDBCConnectionPoolDataSource
java.lang.Object
|
+--com.ibm.as400.access.AS400JDBCDataSource
|
+--com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
- All Implemented Interfaces:
- javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable
- public class AS400JDBCConnectionPoolDataSource
- extends AS400JDBCDataSource
- implements javax.sql.ConnectionPoolDataSource, javax.naming.Referenceable, java.io.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
Constructor Summary |
AS400JDBCConnectionPoolDataSource()
Constructs a default AS400JDBCConnectionPoolDataSource object. |
AS400JDBCConnectionPoolDataSource(java.lang.String serverName)
Constructs an AS400JDBCConnectionPoolDataSource with the specified serverName. |
AS400JDBCConnectionPoolDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password)
Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information. |
AS400JDBCConnectionPoolDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password,
java.lang.String keyRingName,
java.lang.String keyRingPassword)
Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information
to use for SSL communications with the server. |
Method Summary |
javax.sql.PooledConnection |
getPooledConnection()
Returns a pooled connection that is connected to the server. |
javax.sql.PooledConnection |
getPooledConnection(java.lang.String user,
java.lang.String password)
Returns a pooled connection that is connected to the server. |
javax.naming.Reference |
getReference()
Returns the Reference object for the data source object. |
Methods inherited from class com.ibm.as400.access.AS400JDBCDataSource |
addPropertyChangeListener, getAccess, getBidiStringType, getBlockCriteria, getBlockSize, getConnection, getConnection, getDatabaseName, getDataSourceName, getDateFormat, getDateSeparator, getDecimalSeparator, getDescription, getDriver, getErrors, getLibraries, getLobThreshold, getLoginTimeout, getLogWriter, getNaming, getPackage, getPackageCriteria, getPackageError, getPackageLibrary, getProxyServer, getRemarks, getSecondaryUrl, getServerName, getServerTraceCategories, getSort, getSortLanguage, getSortTable, getSortWeight, getTimeFormat, getTimeSeparator, getTransactionIsolation, getUser, isBigDecimal, isCursorHold, isDataCompression, isDataTruncation, isExtendedDynamic, isExtendedMetaData, isFullOpen, isLazyClose, isPackageAdd, isPackageCache, isPackageClear, isPrefetch, isPrompt, isSavePasswordWhenSerialized, isSecure, isThreadUsed, isTrace, isTranslateBinary, removePropertyChangeListener, setAccess, setBidiStringType, setBigDecimal, setBlockCriteria, setBlockSize, setCursorHold, setDatabaseName, setDataCompression, setDataSourceName, setDataTruncation, setDateFormat, setDateSeparator, setDecimalSeparator, setDescription, setDriver, setErrors, setExtendedDynamic, setExtendedMetaData, setFullOpen, setLazyClose, setLibraries, setLobThreshold, setLoginTimeout, setLogWriter, setNaming, setPackage, setPackageAdd, setPackageCache, setPackageClear, setPackageCriteria, setPackageError, setPackageLibrary, setPassword, setPrefetch, setPrompt, setProxyServer, setRemarks, setSavePasswordWhenSerialized, setSecondaryUrl, setSecure, setServerName, setServerTraceCategories, setSort, setSortLanguage, setSortTable, setSortWeight, setThreadUsed, setTimeFormat, setTimeSeparator, setTrace, setTransactionIsolation, setTranslateBinary, setUser, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.sql.ConnectionPoolDataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
AS400JDBCConnectionPoolDataSource
public AS400JDBCConnectionPoolDataSource()
- Constructs a default AS400JDBCConnectionPoolDataSource object.
AS400JDBCConnectionPoolDataSource
public AS400JDBCConnectionPoolDataSource(java.lang.String serverName)
- Constructs an AS400JDBCConnectionPoolDataSource with the specified serverName.
- Parameters:
serverName
- The name of the AS/400 or iSeries server.
AS400JDBCConnectionPoolDataSource
public AS400JDBCConnectionPoolDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password)
- Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information.
- Parameters:
serverName
- The AS/400 or iSeries system name.user
- The user id.password
- The password.
AS400JDBCConnectionPoolDataSource
public AS400JDBCConnectionPoolDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password,
java.lang.String keyRingName,
java.lang.String keyRingPassword)
- Constructs an AS400JDBCConnectionPoolDataSource with the specified signon information
to use for SSL communications with the server.
- Parameters:
serverName
- The AS/400 or iSeries system name.user
- The user id.password
- The password.keyRingName
- The key ring class name to be used for SSL communications with the server.keyRingPassword
- The password for the key ring class to be used for SSL communications with the server.
getPooledConnection
public javax.sql.PooledConnection getPooledConnection()
throws java.sql.SQLException
- Returns a pooled connection that is connected to the server.
- Specified by:
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
- Returns:
- A pooled connection.
- Throws:
java.sql.SQLException
- If a database error occurs.
getPooledConnection
public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
- Returns a pooled connection that is connected to the server.
- Specified by:
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
- Parameters:
user
- The userid for the connection.password
- The password for the connection.- Returns:
- A pooled connection.
- Throws:
java.sql.SQLException
- If a database error occurs.
getReference
public javax.naming.Reference getReference()
throws javax.naming.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 javax.naming.Referenceable
- Overrides:
getReference
in class AS400JDBCDataSource
- Returns:
- A Reference object for the data source object.
- Throws:
javax.naming.NamingException
- If a naming error occurs resolving the object.