com.ibatis.common.jdbc
public class SimpleDataSource extends Object implements DataSource
| Nested Class Summary | |
|---|---|
| static class | SimpleDataSource.SimplePooledConnection
---------------------------------------------------------------------------------------
SimplePooledConnection
--------------------------------------------------------------------------------------- |
| Constructor Summary | |
|---|---|
| SimpleDataSource(Map props)
Constructor to allow passing in a map of properties for configuration
| |
| Method Summary | |
|---|---|
| protected void | finalize() |
| void | forceCloseAll()
Closes all of the connections in the pool |
| long | getAverageCheckoutTime()
Getter for the average age of a connection checkout |
| long | getAverageOverdueCheckoutTime()
Getter for the average age of overdue connections |
| long | getAverageRequestTime()
Getter for the average time required to get a connection to the database |
| long | getAverageWaitTime()
Getter for the average time spent waiting for connections that were in use |
| long | getBadConnectionCount()
Getter for the number of invalid connections that were found in the pool |
| long | getClaimedOverdueConnectionCount()
Getter for the number of connections that were claimed before they were returned |
| Connection | getConnection() |
| Connection | getConnection(String username, String password) |
| long | getHadToWaitCount()
Getter for the number of requests that had to wait for connections that were in use |
| String | getJdbcDriver()
Getter for the name of the JDBC driver class used |
| String | getJdbcPassword()
Getter for the JDBC password used |
| String | getJdbcUrl()
Getter of the JDBC URL used |
| String | getJdbcUsername()
Getter for the JDBC user name used |
| int | getLoginTimeout() |
| PrintWriter | getLogWriter() |
| int | getPoolMaximumActiveConnections()
Getter for the maximum number of active connections |
| int | getPoolMaximumCheckoutTime()
Getter for the maximum time a connection can be used before it *may* be
given away again. |
| int | getPoolMaximumIdleConnections()
Getter for the maximum number of idle connections |
| int | getPoolPingConnectionsNotUsedFor()
If a connection has not been used in this many milliseconds, ping the
database to make sure the connection is still good.
|
| int | getPoolPingConnectionsOlderThan()
Getter for the age of connections that should be pinged before using |
| String | getPoolPingQuery()
Getter for the query to be used to check a connection |
| int | getPoolTimeToWait()
Getter for the time to wait before retrying to get a connection |
| long | getRequestCount()
Getter for the number of connection requests made |
| String | getStatus()
Returns the status of the connection pool |
| boolean | isPoolPingEnabled()
Getter to tell if we should use the ping query |
| void | setLoginTimeout(int loginTimeout) |
| void | setLogWriter(PrintWriter logWriter) |
| static Connection | unwrapConnection(Connection conn)
Unwraps a pooled connection to get to the 'real' connection
|
Parameters: props - the configuration parameters
Returns: The average age
Returns: The average age
Returns: The average time
Returns: The average time
Returns: The number of invalid connections
Returns: The number of connections
See Also: javax.sql.DataSource#getConnection()
See Also: javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
Returns: The number of requests that had to wait
Returns: The name of the class
Returns: The password
Returns: The JDBC URL
Returns: The user name
See Also: javax.sql.DataSource#getLoginTimeout()
See Also: javax.sql.DataSource#getLogWriter()
Returns: The maximum number of active connections
Returns: The maximum time
Returns: The maximum number of idle connections
Returns: the number of milliseconds of inactivity that will trigger a ping
Returns: The age
Returns: The query
Returns: The time to wait
Returns: The number of connection requests made
Returns: The status
Returns: True if we need to check a connection before using it
See Also: javax.sql.DataSource#setLoginTimeout(int)
See Also: javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
Parameters: conn - the pooled connection to unwrap
Returns: The 'real' connection