vibur / vibur-dbcp

Vibur DBCP - concurrent and dynamic JDBC connection pool
http://www.vibur.org
Apache License 2.0
96 stars 11 forks source link

Vibur JNDI datasource with tomcat 7 #6

Closed alqershi closed 8 years ago

alqershi commented 8 years ago

Can You define vibur as JNDI datasource with tomcat 7 like C3P0:

<Resource name="jdbc/ContentDBDatasource" auth="Container"
        type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/content?useUnicode=true&amp;characterEncoding=UTF-8"
        username="xxx" password="xxx" maxActive="15" maxIdle="7"
        defaultTransactionIsolation="READ_COMMITTED" validationQuery="Select 1"/>
simeonmalchev commented 8 years ago

I believe that the config that you're looking for should be something like:

<Resource name="jdbc/ContentDBDatasource" auth="Container" factory="org.vibur.dbcp.ViburDBCPObjectFactory" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" jdbcUrl="jdbc:mysql://localhost:3306/content?useUnicode=true&amp;characterEncoding=UTF-8" username="xxx" password="xxx" poolMaxSize="15" defaultTransactionIsolation="READ_COMMITTED" validationQuery="isValid"/>