org.mybatis.guice.datasource.builtin
Class PooledDataSourceProvider
java.lang.Object
org.mybatis.guice.datasource.builtin.PooledDataSourceProvider
- All Implemented Interfaces:
- com.google.inject.Provider<DataSource>
public final class PooledDataSourceProvider
- extends Object
- implements com.google.inject.Provider<DataSource>
Provides the myBatis built-in PooledDataSource.
- Version:
- $Id: PooledDataSourceProvider.java 2228 2010-08-03 19:45:13Z simone.tripodi $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PooledDataSourceProvider
@Inject
public PooledDataSourceProvider(String driver,
String url,
String username,
String password)
- Creates a new PooledDataSource using the needed parameter.
- Parameters:
driver - The JDBC driver class.url - the database URL of the form jdbc:subprotocol:subname.username - the database user.password - the user's password.
setAutoCommit
@Inject(optional=true)
public void setAutoCommit(boolean autoCommit)
- Parameters:
autoCommit -
setLoginTimeout
@Inject(optional=true)
public void setLoginTimeout(int loginTimeout)
- Parameters:
loginTimeout -
setDriverProperties
@Inject(optional=true)
public void setDriverProperties(Properties driverProperties)
setMaximumActiveConnections
@Inject(optional=true)
public void setMaximumActiveConnections(int maximumActiveConnections)
- Parameters:
maximumActiveConnections -
setMaximumCheckoutTime
@Inject(optional=true)
public void setMaximumCheckoutTime(int maximumCheckoutTime)
- Parameters:
maximumCheckoutTime -
setMaximumIdleConnections
@Inject(optional=true)
public void setMaximumIdleConnections(int maximumIdleConnections)
- Parameters:
maximumIdleConnections -
setPingConnectionsNotUsedFor
@Inject(optional=true)
public void setPingConnectionsNotUsedFor(int pingConnectionsNotUsedFor)
- Parameters:
pingConnectionsNotUsedFor -
setPingEnabled
@Inject(optional=true)
public void setPingEnabled(boolean pingEnabled)
- Parameters:
pingEnabled -
setPingEnabled
@Inject(optional=true)
public void setPingEnabled(String pingQuery)
- Parameters:
pingQuery -
setTimeToWait
@Inject(optional=true)
public void setTimeToWait(int timeToWait)
- Parameters:
timeToWait -
get
public DataSource get()
-
- Specified by:
get in interface com.google.inject.Provider<DataSource>
Copyright © 2010 MyBatis.org. All Rights Reserved.