org.apache.ibatis.datasource.pooled
Class PooledDataSource

java.lang.Object
  extended by org.apache.ibatis.datasource.pooled.PooledDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class PooledDataSource
extends Object
implements DataSource


Field Summary
protected  int poolMaximumActiveConnections
           
protected  int poolMaximumCheckoutTime
           
protected  int poolMaximumIdleConnections
           
protected  int poolPingConnectionsNotUsedFor
           
protected  boolean poolPingEnabled
           
protected  String poolPingQuery
           
protected  int poolTimeToWait
           
 
Constructor Summary
PooledDataSource()
           
PooledDataSource(ClassLoader driverClassLoader, String driver, String url, Properties driverProperties)
           
PooledDataSource(ClassLoader driverClassLoader, String driver, String url, String username, String password)
           
PooledDataSource(String driver, String url, Properties driverProperties)
           
PooledDataSource(String driver, String url, String username, String password)
           
 
Method Summary
protected  void finalize()
           
 void forceCloseAll()
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 Integer getDefaultTransactionIsolationLevel()
           
 String getDriver()
           
 Properties getDriverProperties()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 Logger getParentLogger()
           
 String getPassword()
           
 int getPoolMaximumActiveConnections()
           
 int getPoolMaximumCheckoutTime()
           
 int getPoolMaximumIdleConnections()
           
 int getPoolPingConnectionsNotUsedFor()
           
 String getPoolPingQuery()
           
 PoolState getPoolState()
           
 int getPoolTimeToWait()
           
 String getUrl()
           
 String getUsername()
           
 boolean isAutoCommit()
           
 boolean isPoolPingEnabled()
           
 boolean isWrapperFor(Class<?> iface)
           
protected  boolean pingConnection(org.apache.ibatis.datasource.pooled.PooledConnection conn)
           
protected  void pushConnection(org.apache.ibatis.datasource.pooled.PooledConnection conn)
           
 void setDefaultAutoCommit(boolean defaultAutoCommit)
           
 void setDefaultTransactionIsolationLevel(Integer defaultTransactionIsolationLevel)
           
 void setDriver(String driver)
           
 void setDriverProperties(Properties driverProps)
           
 void setLoginTimeout(int loginTimeout)
           
 void setLogWriter(PrintWriter logWriter)
           
 void setPassword(String password)
           
 void setPoolMaximumActiveConnections(int poolMaximumActiveConnections)
           
 void setPoolMaximumCheckoutTime(int poolMaximumCheckoutTime)
           
 void setPoolMaximumIdleConnections(int poolMaximumIdleConnections)
           
 void setPoolPingConnectionsNotUsedFor(int milliseconds)
           
 void setPoolPingEnabled(boolean poolPingEnabled)
           
 void setPoolPingQuery(String poolPingQuery)
           
 void setPoolTimeToWait(int poolTimeToWait)
           
 void setUrl(String url)
           
 void setUsername(String username)
           
<T> T
unwrap(Class<T> iface)
           
static Connection unwrapConnection(Connection conn)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

poolMaximumActiveConnections

protected int poolMaximumActiveConnections

poolMaximumIdleConnections

protected int poolMaximumIdleConnections

poolMaximumCheckoutTime

protected int poolMaximumCheckoutTime

poolTimeToWait

protected int poolTimeToWait

poolPingQuery

protected String poolPingQuery

poolPingEnabled

protected boolean poolPingEnabled

poolPingConnectionsNotUsedFor

protected int poolPingConnectionsNotUsedFor
Constructor Detail

PooledDataSource

public PooledDataSource()

PooledDataSource

public PooledDataSource(String driver,
                        String url,
                        String username,
                        String password)

PooledDataSource

public PooledDataSource(String driver,
                        String url,
                        Properties driverProperties)

PooledDataSource

public PooledDataSource(ClassLoader driverClassLoader,
                        String driver,
                        String url,
                        String username,
                        String password)

PooledDataSource

public PooledDataSource(ClassLoader driverClassLoader,
                        String driver,
                        String url,
                        Properties driverProperties)
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int loginTimeout)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter logWriter)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setDriver

public void setDriver(String driver)

setUrl

public void setUrl(String url)

setUsername

public void setUsername(String username)

setPassword

public void setPassword(String password)

setDefaultAutoCommit

public void setDefaultAutoCommit(boolean defaultAutoCommit)

setDefaultTransactionIsolationLevel

public void setDefaultTransactionIsolationLevel(Integer defaultTransactionIsolationLevel)

setDriverProperties

public void setDriverProperties(Properties driverProps)

setPoolMaximumActiveConnections

public void setPoolMaximumActiveConnections(int poolMaximumActiveConnections)

setPoolMaximumIdleConnections

public void setPoolMaximumIdleConnections(int poolMaximumIdleConnections)

setPoolMaximumCheckoutTime

public void setPoolMaximumCheckoutTime(int poolMaximumCheckoutTime)

setPoolTimeToWait

public void setPoolTimeToWait(int poolTimeToWait)

setPoolPingQuery

public void setPoolPingQuery(String poolPingQuery)

setPoolPingEnabled

public void setPoolPingEnabled(boolean poolPingEnabled)

setPoolPingConnectionsNotUsedFor

public void setPoolPingConnectionsNotUsedFor(int milliseconds)

getDriver

public String getDriver()

getUrl

public String getUrl()

getUsername

public String getUsername()

getPassword

public String getPassword()

isAutoCommit

public boolean isAutoCommit()

getDefaultTransactionIsolationLevel

public Integer getDefaultTransactionIsolationLevel()

getDriverProperties

public Properties getDriverProperties()

getPoolMaximumActiveConnections

public int getPoolMaximumActiveConnections()

getPoolMaximumIdleConnections

public int getPoolMaximumIdleConnections()

getPoolMaximumCheckoutTime

public int getPoolMaximumCheckoutTime()

getPoolTimeToWait

public int getPoolTimeToWait()

getPoolPingQuery

public String getPoolPingQuery()

isPoolPingEnabled

public boolean isPoolPingEnabled()

getPoolPingConnectionsNotUsedFor

public int getPoolPingConnectionsNotUsedFor()

forceCloseAll

public void forceCloseAll()

getPoolState

public PoolState getPoolState()

pushConnection

protected void pushConnection(org.apache.ibatis.datasource.pooled.PooledConnection conn)
                       throws SQLException
Throws:
SQLException

pingConnection

protected boolean pingConnection(org.apache.ibatis.datasource.pooled.PooledConnection conn)

unwrapConnection

public static Connection unwrapConnection(Connection conn)

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException

getParentLogger

public Logger getParentLogger()


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.