-
Notifications
You must be signed in to change notification settings - Fork 3k
JNDI DataSource Factory (Tomcat, etc.)
Brett Wooldridge edited this page Aug 19, 2015
·
4 revisions
HikariCP includes a JNDI DataSource factory that can be used with Tomcat or other containers.
Example (Tomcat) configurations:
Driver-based:
<Resource name="jdbc/OracleHikari" auth="Container"
factory="com.zaxxer.hikari.HikariJNDIFactory"
type="javax.sql.DataSource"
minimumIdle="5"
maximumPoolSize="10"
connectionTimeout="300000"
jdbcUrl="jdbc:oracle:thin:@orcl_server:1521:orcl"
dataSource.implicitCachingEnabled="true"
dataSource.user="user"
dataSource.password="pwd" />
DataSource-based:
<Resource name="jdbc/OracleHikari" auth="Container"
factory="com.zaxxer.hikari.HikariJNDIFactory"
type="javax.sql.DataSource"
minimumIdle="5"
maximumPoolSize="10"
connectionTimeout="300000"
dataSourceClassName="oracle.jdbc.pool.OracleDataSource"
dataSource.implicitCachingEnabled="true"
dataSource.user="user"
dataSource.password="pwd"
dataSource.url="jdbc:oracle:thin:@orcl_server:1521:orcl"/>
A MariaDB example:
<Context>
<Resource name="jdbc/myDs" auth="Container"
factory="com.zaxxer.hikari.HikariJNDIFactory"
type="javax.sql.DataSource"
minimumIdle="5"
maximumPoolSize="10"
connectionTimeout="300000"
dataSourceClassName="org.mariadb.jdbc.MySQLDataSource"
dataSource.serverName="localhost"
dataSource.port="3306"
dataSource.databaseName="myDatabase"
dataSource.user="username"
dataSource.password="password"
/>
</Context>