Creating datasources and a connection pool

To create a datasource and a connection pool to help you use databases in your project, edit the $TOMEE_HOME/conf/tomee.xml file.

Inside the <tomee> node, insert a child node like this one:

  <Resource id="MyDataSouceDs" type="javax.sql.DataSource">
jdbcDriver = org.postgresql.Driver
jdbcUrl = jdbc:postgresql://[host]:[port]/[database]
jtaManaged = true
maxActive = 20
maxIdle = 20
minIdle = 0
userName = user
password = password
</Resource>

The example targets PostgreSQL, so you will need to perform some changes for another database. Of course, you will also need to change the other parameters according to your needs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.166.31