Class C3p0DataSourceProvider
java.lang.Object
org.mybatis.guice.datasource.c3p0.C3p0DataSourceProvider
- All Implemented Interfaces:
jakarta.inject.Provider<DataSource>
public final class C3p0DataSourceProvider
extends Object
implements jakarta.inject.Provider<DataSource>
Provides the C3P0 DataSource.
-
Constructor Summary
ConstructorsConstructorDescriptionC3p0DataSourceProvider(String driver, String url) Creates a new ComboPooledDataSource using the needed parameter. -
Method Summary
Modifier and TypeMethodDescriptionget()voidsetAautomaticTestTable(String automaticTestTable) Sets the aautomatic test table.voidsetAcquireIncrement(int acquireIncrement) Sets the acquire increment.voidsetAcquireRetryAttempts(int acquireRetryAttempts) Sets the acquire retry attempts.voidsetAcquireRetryDelay(int acquireRetryDelay) Sets the acquire retry delay.voidsetAutoCommitOnClose(boolean autoCommit) Sets the auto commit on close.voidsetBreakAfterAcquireFailure(boolean breakAfterAcquireFailure) Sets the break after acquire failure.voidsetCheckoutTimeout(int checkoutTimeout) Sets the checkout timeout.voidsetConnectionCustomizerClassName(String connectionCustomizerClassName) Sets the connection customizer class name.voidsetConnectionTesterClassName(String connectionTesterClassName) Sets the connection tester class name.voidsetDriverProperties(Properties driverProperties) Sets the driver properties.voidsetIdleConnectionTestPeriod(int idleConnectionTestPeriod) Sets the idle connection test period.voidsetInitialPoolSize(int initialPoolSize) Sets the initial pool size.voidsetMaxAdministrativeTaskTime(int maxAdministrativeTaskTime) Sets the max administrative task time.voidsetMaxConnectionAge(int maxConnectionAge) Sets the max connection age.voidsetMaxIdleTime(int maxIdleTime) Sets the max idle time.voidsetMaxIdleTimeExcessConnections(int maxIdleTimeExcessConnections) Sets the max idle time excess connections.voidsetMaxPoolSize(int maxPoolSize) Sets the max pool size.voidsetMaxStatements(int maxStatements) Sets the max statements.voidsetMaxStatementsPerConnection(int maxStatementsPerConnection) Sets the max statements per connection.voidsetMinPoolSize(int minPoolSize) Sets the min pool size.voidsetPassword(String password) Sets the password.voidsetPreferredTestQuery(String preferredTestQuery) Sets the preferred test query.voidsetPropertyCycle(int propertyCycle) Sets the property cycle.voidsetTestConnectionOnCheckin(boolean testConnectionOnCheckin) Sets the test connection on checkin.voidsetTestConnectionOnCheckout(boolean testConnectionOnCheckout) Sets the test connection on checkout.voidsetUnreturnedConnectionTimeout(int unreturnedConnectionTimeout) Sets the unreturned connection timeout.voidSets the user.
-
Constructor Details
-
C3p0DataSourceProvider
-
-
Method Details
-
setUser
Sets the user.- Parameters:
username- the new user- Since:
- 3.3
-
setPassword
Sets the password.- Parameters:
password- the new password- Since:
- 3.3
-
setAcquireIncrement
@Inject(optional=true) public void setAcquireIncrement(@Named("c3p0.acquireIncrement") int acquireIncrement) Sets the acquire increment.- Parameters:
acquireIncrement- the new acquire increment
-
setAcquireRetryAttempts
@Inject(optional=true) public void setAcquireRetryAttempts(@Named("c3p0.acquireRetryAttempts") int acquireRetryAttempts) Sets the acquire retry attempts.- Parameters:
acquireRetryAttempts- the new acquire retry attempts
-
setAcquireRetryDelay
@Inject(optional=true) public void setAcquireRetryDelay(@Named("c3p0.acquireRetryDelay") int acquireRetryDelay) Sets the acquire retry delay.- Parameters:
acquireRetryDelay- the new acquire retry delay
-
setAutoCommitOnClose
@Inject(optional=true) public void setAutoCommitOnClose(@Named("JDBC.autoCommit") boolean autoCommit) Sets the auto commit on close.- Parameters:
autoCommit- the new auto commit on close
-
setDriverProperties
@Inject(optional=true) public void setDriverProperties(@Named("JDBC.driverProperties") Properties driverProperties) Sets the driver properties.- Parameters:
driverProperties- the new driver properties
-
setAautomaticTestTable
@Inject(optional=true) public void setAautomaticTestTable(@Named("c3p0.automaticTestTable") String automaticTestTable) Sets the aautomatic test table.- Parameters:
automaticTestTable- the new aautomatic test table
-
setBreakAfterAcquireFailure
@Inject(optional=true) public void setBreakAfterAcquireFailure(@Named("c3p0.breakAfterAcquireFailure") boolean breakAfterAcquireFailure) Sets the break after acquire failure.- Parameters:
breakAfterAcquireFailure- the new break after acquire failure
-
setCheckoutTimeout
@Inject(optional=true) public void setCheckoutTimeout(@Named("c3p0.checkoutTimeout") int checkoutTimeout) Sets the checkout timeout.- Parameters:
checkoutTimeout- the new checkout timeout
-
setConnectionCustomizerClassName
@Inject(optional=true) public void setConnectionCustomizerClassName(@Named("c3p0.connectionCustomizerClassName") String connectionCustomizerClassName) Sets the connection customizer class name.- Parameters:
connectionCustomizerClassName- the new connection customizer class name
-
setConnectionTesterClassName
@Inject(optional=true) public void setConnectionTesterClassName(@Named("c3p0.connectionTesterClassName") String connectionTesterClassName) Sets the connection tester class name.- Parameters:
connectionTesterClassName- the new connection tester class name
-
setIdleConnectionTestPeriod
@Inject(optional=true) public void setIdleConnectionTestPeriod(@Named("c3p0.idleConnectionTestPeriod") int idleConnectionTestPeriod) Sets the idle connection test period.- Parameters:
idleConnectionTestPeriod- the new idle connection test period
-
setInitialPoolSize
@Inject(optional=true) public void setInitialPoolSize(@Named("c3p0.initialPoolSize") int initialPoolSize) Sets the initial pool size.- Parameters:
initialPoolSize- the new initial pool size
-
setMaxAdministrativeTaskTime
@Inject(optional=true) public void setMaxAdministrativeTaskTime(@Named("c3p0.maxAdministrativeTaskTime") int maxAdministrativeTaskTime) Sets the max administrative task time.- Parameters:
maxAdministrativeTaskTime- the new max administrative task time
-
setMaxConnectionAge
@Inject(optional=true) public void setMaxConnectionAge(@Named("c3p0.maxConnectionAge") int maxConnectionAge) Sets the max connection age.- Parameters:
maxConnectionAge- the new max connection age
-
setMaxIdleTime
@Inject(optional=true) public void setMaxIdleTime(@Named("c3p0.maxIdleTime") int maxIdleTime) Sets the max idle time.- Parameters:
maxIdleTime- the new max idle time
-
setMaxIdleTimeExcessConnections
@Inject(optional=true) public void setMaxIdleTimeExcessConnections(@Named("c3p0.maxIdleTimeExcessConnections") int maxIdleTimeExcessConnections) Sets the max idle time excess connections.- Parameters:
maxIdleTimeExcessConnections- the new max idle time excess connections
-
setMaxPoolSize
@Inject(optional=true) public void setMaxPoolSize(@Named("c3p0.maxPoolSize") int maxPoolSize) Sets the max pool size.- Parameters:
maxPoolSize- the new max pool size
-
setMaxStatements
@Inject(optional=true) public void setMaxStatements(@Named("c3p0.maxStatements") int maxStatements) Sets the max statements.- Parameters:
maxStatements- the new max statements
-
setMaxStatementsPerConnection
@Inject(optional=true) public void setMaxStatementsPerConnection(@Named("c3p0.maxStatementsPerConnection") int maxStatementsPerConnection) Sets the max statements per connection.- Parameters:
maxStatementsPerConnection- the new max statements per connection
-
setMinPoolSize
@Inject(optional=true) public void setMinPoolSize(@Named("c3p0.minPoolSize") int minPoolSize) Sets the min pool size.- Parameters:
minPoolSize- the new min pool size
-
setPreferredTestQuery
@Inject(optional=true) public void setPreferredTestQuery(@Named("c3p0.preferredTestQuery") String preferredTestQuery) Sets the preferred test query.- Parameters:
preferredTestQuery- the new preferred test query
-
setPropertyCycle
@Inject(optional=true) public void setPropertyCycle(@Named("c3p0.propertyCycle") int propertyCycle) Sets the property cycle.- Parameters:
propertyCycle- the new property cycle
-
setTestConnectionOnCheckin
@Inject(optional=true) public void setTestConnectionOnCheckin(@Named("c3p0.testConnectionOnCheckin") boolean testConnectionOnCheckin) Sets the test connection on checkin.- Parameters:
testConnectionOnCheckin- the new test connection on checkin
-
setTestConnectionOnCheckout
@Inject(optional=true) public void setTestConnectionOnCheckout(@Named("c3p0.testConnectionOnCheckout") boolean testConnectionOnCheckout) Sets the test connection on checkout.- Parameters:
testConnectionOnCheckout- the new test connection on checkout
-
setUnreturnedConnectionTimeout
@Inject(optional=true) public void setUnreturnedConnectionTimeout(@Named("c3p0.unreturnedConnectionTimeout") int unreturnedConnectionTimeout) Sets the unreturned connection timeout.- Parameters:
unreturnedConnectionTimeout- the new unreturned connection timeout
-
get
- Specified by:
getin interfacejakarta.inject.Provider<DataSource>
-