Druid Data Source Provider

The org.mybatis.guice.datasource.druid package contains Google Guice providers for Druid Data Source implementations.

for Apache Maven users the Druid dependency is not transitive, so they have to take care about including it in their applications.

The table below contains all of the available properties for the Provider; for more details please consult the Official reference.

org.mybatis.guice.datasource.druid.DruidDataSourceProvider properties
Property Required Bind to Java Type
JDBC.driver true java.lang.String
JDBC.url true java.lang.String
JDBC.username true java.lang.String
JDBC.password true java.lang.String
JDBC.autoCommit false boolean
JDBC.readOnly false boolean
JDBC.transactionIsolation false int
JDBC.catalog false java.lang.String
JDBC.maxActive false int
JDBC.minIdle false int
JDBC.initialSize false int
JDBC.maxWait false long
JDBC.testOnBorrow false boolean
JDBC.testOnReturn false boolean
JDBC.timeBetweenEvictionRunsMillis false long
JDBC.minEvictableIdleTimeMillis false long
JDBC.testWhileIdle false boolean
JDBC.validationQuery false java.lang.String
JDBC.validationQueryTimeout false int
JDBC.accessToUnderlyingConnectionAllowed false boolean
JDBC.removeAbandoned false boolean
JDBC.removeAbandonedTimeout false int
JDBC.logAbandoned false boolean
JDBC.poolPreparedStatements false boolean
JDBC.maxOpenPreparedStatements false int
JDBC.connectionProperties false java.lang.String
JDBC.connectionProperties false java.util.Properties
JDBC.filters false java.lang.String
JDBC.exceptionSorter false java.lang.String
JDBC.exceptionSorterClassName false java.lang.String