|
i-net DB2 drivers | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inet.drda.DRDADataSource com.inet.drda.PDataSource
public class PDataSource
This class is the implementation of the ConnectionPoolDataSource in the driver. A sample can be found in the file sample/WithPoolDataSource.java.
Constructor Summary | |
---|---|
PDataSource()
Create an empty DataSource. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this ConnectionPoolDataSource to the specified object. |
java.sql.Connection |
getConnection()
override the method in TdsDataSource. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
override the method in TdsDataSource. |
java.lang.String |
getFailoverListener()
Returns the value of the property failoverListener. |
int |
getInitialPoolSize()
Get the number of physical connections the pool should contain when it is created. |
int |
getMaxIdleTime()
Get the number of seconds that a physical connection should remain unused in the pool before the connection is closed. |
int |
getMaxPoolSize()
Get the maximum number of physical connections that the pool should contain. |
int |
getMaxStatements()
Get the total number of statements that the pool should keep open. |
int |
getMinPoolSize()
Get the number of physical connections the pool should keep available at all times. |
javax.sql.PooledConnection |
getPooledConnection()
This method creates a real connection to the SQL Server with the parameter of this DataSource. |
javax.sql.PooledConnection |
getPooledConnection(java.lang.String user,
java.lang.String password)
This method creates a real connection to the SQL Server with the parameter of this DataSource. |
int |
getPropertyCycle()
Get the interval, in seconds, that the pool should wait before enforcing the current policy defined by the values of the above connection pool properties. |
int |
getTotalTimeOfAttempts()
Returns the value of the property totalTimeOfAttempts. |
boolean |
getUseDefaultFailoverListener()
Returns the value of the property useDefaultFailoverListener. |
int |
getWaitTimeToNextAttempt()
Returns the value of the property waitTimeToNextAttempt. |
void |
setFailoverListener(java.lang.String failoverListener)
Sets the property failoverListener. |
void |
setInitialPoolSize(int initialPoolSize)
Set the number of physical connections the pool should contain when it is created. |
void |
setMaxIdleTime(int maxIdleTime)
Set the number of seconds that a physical connection should remain unused in the pool before the connection is closed. |
void |
setMaxPoolSize(int maxPoolSize)
Set the maximum number of physical connections that the pool should contain. |
void |
setMaxStatements(int maxStatements)
Set the total number of statements that the pool should keep open. |
void |
setMinPoolSize(int minPoolSize)
Set the number of physical connections the pool should keep available at all times. |
void |
setPropertyCycle(int propertyCycle)
Set the interval, in seconds, that the pool should wait before enforcing the current policy defined by the values of the above connection pool properties. |
void |
setTotalTimeOfAttempts(int totalTimeOfAttempts)
Sets the property totalTimeOfAttempts. |
void |
setUseDefaultFailoverListener(boolean useDefaultFailoverListener)
Sets the property useDefaultFailoverListener. |
void |
setWaitTimeToNextAttempt(int waitTimeToNextAttempt)
Sets the property waitTimeToNextAttempt. |
Methods inherited from class com.inet.drda.DRDADataSource |
---|
addWarning, clone, getDatabaseName, getDescription, getInitSQL, getLoginTimeout, getLogWriter, getPassword, getPort, getPortNumber, getProperties, getProperty, getQueryTimeout, getReference, getServerName, getUser, setDatabaseName, setDescription, setInitSQL, setLoginTimeout, setLogWriter, setPassword, setPort, setPortNumber, setProperties, setProperty, setProperty, setQueryTimeout, setServerName, setUser, toString |
Methods inherited from class java.lang.Object |
---|
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 PDataSource() throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
getConnection
in class DRDADataSource
java.sql.SQLException
- if a database-access error occurs.DRDADataSource.getConnection()
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
getConnection
in class DRDADataSource
username
- password
-
java.sql.SQLException
- if a database-access error occurs.DRDADataSource.getConnection(String,String)
public javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
java.sql.SQLException
- if a database-access error occurs.public javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
user
- the database user on whose behalf the Connection is being made.password
- the user's password.
java.sql.SQLException
- if a database-access error occurs.public boolean equals(java.lang.Object obj)
equals
in class DRDADataSource
obj
- the object to compare.
public void setMaxStatements(int maxStatements)
An application server managing a pool of PooledConnection objects uses these properties to determine how to manage its pool. i-net PLEXA and the method getConnection() is not using this property.
maxStatements
- number of statements that the pool should keep open.
0 (zero) indicates that caching of statements is disabled.getMaxStatements()
public int getMaxStatements()
setMaxStatements(int)
public void setInitialPoolSize(int initialPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
initialPoolSize
- the number of physical connections the pool should contain when it is created.getInitialPoolSize()
public int getInitialPoolSize()
setInitialPoolSize(int)
public void setMinPoolSize(int minPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
minPoolSize
- the number of physical connections the pool should keep available at all times.getMinPoolSize()
public int getMinPoolSize()
setMinPoolSize(int)
public void setMaxPoolSize(int maxPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
maxPoolSize
- the maximum number of physical connections that the pool should contain. 0 (zero) indicates no maximum size.getMaxPoolSize()
,
PoolManager.setMaxPoolSize(int)
public int getMaxPoolSize()
setMaxPoolSize(int)
public void setMaxIdleTime(int maxIdleTime)
i-net PLEXA(tm) and the method getConnection() use this property.
maxIdleTime
- the number of seconds that a physical connection should remain unused in the pool before the connection is closed. 0 (zero) indicates no limit.getMaxIdleTime()
,
PoolManager.setMaxIdleTime(int)
public int getMaxIdleTime()
setMaxIdleTime(int)
public void setPropertyCycle(int propertyCycle)
An application server managing a pool of PooledConnection objects uses these properties to determine how to manage its pool. i-net PLEXA(tm) and the method getConnection() do not use this property.
propertyCycle
- the interval, in seconds, that the pool should wait before enforcing the current policy defined by the values of the above connection pool properties.getPropertyCycle()
public int getPropertyCycle()
setPropertyCycle(int)
public void setUseDefaultFailoverListener(boolean useDefaultFailoverListener)
useDefaultFailoverListener
- the value for the property useDefaultFailoverListener.public void setWaitTimeToNextAttempt(int waitTimeToNextAttempt)
waitTimeToNextAttempt
- the value for the property waitTimeToNextAttempt.public void setTotalTimeOfAttempts(int totalTimeOfAttempts)
totalTimeOfAttempts
- the value for the property totalTimeOfAttempts.public void setFailoverListener(java.lang.String failoverListener)
com.inet.pool.FailoverListener
failoverListener
- the value for the property failoverListener.public boolean getUseDefaultFailoverListener()
public int getWaitTimeToNextAttempt()
public int getTotalTimeOfAttempts()
public java.lang.String getFailoverListener()
|
i-net DB2 drivers | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |