|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.access.AS400JDBCDataSource
com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
public class AS400JDBCConnectionPoolDataSource
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();
Field Summary |
---|
Constructor Summary | |
---|---|
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 | ||
---|---|---|
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. |
|
protected String[] |
getValidWrappedList()
|
|
boolean |
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. |
|
|
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. |
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 |
---|
public AS400JDBCConnectionPoolDataSource()
public AS400JDBCConnectionPoolDataSource(String serverName)
serverName
- The IBM i system name.public AS400JDBCConnectionPoolDataSource(String serverName, String user, String password)
serverName
- The IBM i system name.user
- The user id.password
- The password.public AS400JDBCConnectionPoolDataSource(String serverName, String user, String password, String keyRingName, String keyRingPassword)
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 |
---|
public PooledConnection getPooledConnection() throws SQLException
getPooledConnection
in interface ConnectionPoolDataSource
SQLException
- If a database error occurs.public PooledConnection getPooledConnection(String user, String password) throws SQLException
getPooledConnection
in interface ConnectionPoolDataSource
user
- The userid for the connection.password
- The password for the connection.
SQLException
- If a database error occurs.public Reference getReference() throws NamingException
getReference
in interface Referenceable
getReference
in class AS400JDBCDataSource
NamingException
- If a naming error occurs resolving the object.protected String[] getValidWrappedList()
getValidWrappedList
in class AS400JDBCDataSource
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
on the wrapped object. If this does not
implement the interface and is not a wrapper, return false. This method
should be implemented as a low-cost operation compared to
unwrap
so that callers can use this method to avoid
expensive unwrap
calls that may fail. If this method
returns true then calling unwrap
with the same argument
should succeed.
isWrapperFor
in interface Wrapper
iface
- a Class defining an interface.
SQLException
- if an error occurs while determining whether this is a
wrapper for an object with the given interface.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
recursively on the wrapped object or a
proxy for that result. If the receiver is not a wrapper and does not
implement the interface, then an SQLException
is thrown.
unwrap
in interface Wrapper
iface
- A Class defining an interface that the result must implement.
SQLException
- If no object found that implements the interface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |