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
ConstructorDescriptionC3p0DataSourceProvider
(String driver, String url) Creates a new ComboPooledDataSource using the needed parameter. -
Method Summary
Modifier and TypeMethodDescriptionget()
void
setAautomaticTestTable
(String automaticTestTable) Sets the aautomatic test table.void
setAcquireIncrement
(int acquireIncrement) Sets the acquire increment.void
setAcquireRetryAttempts
(int acquireRetryAttempts) Sets the acquire retry attempts.void
setAcquireRetryDelay
(int acquireRetryDelay) Sets the acquire retry delay.void
setAutoCommitOnClose
(boolean autoCommit) Sets the auto commit on close.void
setBreakAfterAcquireFailure
(boolean breakAfterAcquireFailure) Sets the break after acquire failure.void
setCheckoutTimeout
(int checkoutTimeout) Sets the checkout timeout.void
setConnectionCustomizerClassName
(String connectionCustomizerClassName) Sets the connection customizer class name.void
setConnectionTesterClassName
(String connectionTesterClassName) Sets the connection tester class name.void
setDriverProperties
(Properties driverProperties) Sets the driver properties.void
setIdleConnectionTestPeriod
(int idleConnectionTestPeriod) Sets the idle connection test period.void
setInitialPoolSize
(int initialPoolSize) Sets the initial pool size.void
setMaxAdministrativeTaskTime
(int maxAdministrativeTaskTime) Sets the max administrative task time.void
setMaxConnectionAge
(int maxConnectionAge) Sets the max connection age.void
setMaxIdleTime
(int maxIdleTime) Sets the max idle time.void
setMaxIdleTimeExcessConnections
(int maxIdleTimeExcessConnections) Sets the max idle time excess connections.void
setMaxPoolSize
(int maxPoolSize) Sets the max pool size.void
setMaxStatements
(int maxStatements) Sets the max statements.void
setMaxStatementsPerConnection
(int maxStatementsPerConnection) Sets the max statements per connection.void
setMinPoolSize
(int minPoolSize) Sets the min pool size.void
setPassword
(String password) Sets the password.void
setPreferredTestQuery
(String preferredTestQuery) Sets the preferred test query.void
setPropertyCycle
(int propertyCycle) Sets the property cycle.void
setTestConnectionOnCheckin
(boolean testConnectionOnCheckin) Sets the test connection on checkin.void
setTestConnectionOnCheckout
(boolean testConnectionOnCheckout) Sets the test connection on checkout.void
setUnreturnedConnectionTimeout
(int unreturnedConnectionTimeout) Sets the unreturned connection timeout.void
Sets the user.void
setUsesTraditionalReflectiveProxies
(boolean usesTraditionalReflectiveProxies) Sets the uses traditional reflective proxies.
-
Constructor Details
-
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
-
setUsesTraditionalReflectiveProxies
@Inject(optional=true) public void setUsesTraditionalReflectiveProxies(@Named("c3p0.usesTraditionalReflectiveProxies") boolean usesTraditionalReflectiveProxies) Sets the uses traditional reflective proxies.- Parameters:
usesTraditionalReflectiveProxies
- the new uses traditional reflective proxies
-
get
- Specified by:
get
in interfacejakarta.inject.Provider<DataSource>
-