|
i-net JDBC drivers for MS SQL Server | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inet.tds.TdsDriver com.inet.tds.TdsDataSource com.inet.tds.PDataSource
public class PDataSource
This class is the implementation of the ConnectionPoolDataSource in the driver i-net OPTA-xs and MERLIA-xs. A sample can be found in the file sample/WithPoolDataSource.java.
Field Summary |
---|
Fields inherited from class com.inet.tds.TdsDataSource |
---|
MODE_SQLSERVER_65, MODE_SQLSERVER_70, MODE_SQLSERVER_70_ASCII |
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. 0 (zero) indicates no limit. |
int |
getMaxPoolSize()
Get the maximum number of physical connections that the pool should contain. 0 (zero) indicates no maximum size. |
int |
getMaxStatements()
Get the total number of statements that the pool should keep open. 0 (zero) indicates that caching of statements is disabled. |
int |
getMinPoolSize()
Get the number of physical connections the pool should keep available at all times. 0 (zero) indicates that connections should be created as needed. |
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. 0 (zero) indicates no limit. |
void |
setMaxPoolSize(int maxPoolSize)
Set the maximum number of physical connections that the pool should contain. 0 (zero) indicates no maximum size. |
void |
setMaxStatements(int maxStatements)
Set the total number of statements that the pool should keep open. 0 (zero) indicates that caching of statements is disabled. |
void |
setMinPoolSize(int minPoolSize)
Set the number of physical connections the pool should keep available at all times. 0 (zero) indicates that connections should be created as needed. |
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.tds.TdsDriver |
---|
acceptsURL, connect, getMajorVersion, getMinorVersion, getPropertyInfo, jdbcCompliant, run |
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()
Method Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
getConnection
in class TdsDataSource
java.sql.SQLException
- if a database-access error occurs.TdsDataSource.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 TdsDataSource
username
- password
-
java.sql.SQLException
- if a database-access error occurs.TdsDataSource.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 TdsDataSource
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.
getMaxStatements()
public int getMaxStatements()
setMaxStatements(int)
public void setInitialPoolSize(int initialPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
getInitialPoolSize()
public int getInitialPoolSize()
setInitialPoolSize(int)
public void setMinPoolSize(int minPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
getMinPoolSize()
public int getMinPoolSize()
setMinPoolSize(int)
public void setMaxPoolSize(int maxPoolSize)
i-net PLEXA(tm) and the method getConnection() use this property.
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.
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.
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 JDBC drivers for MS SQL Server | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |