Documentation
Space shortcuts

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleSQL Server Datasource
collapsetrue
<Resource
    name="jdbc/myDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="netcom.sourceforgemicrosoft.jtdssqlserver.jdbc.DriverSQLServerDriver"
    url="jdbc:jtds:sqlserver://sqlserver<host>:1433/mydatabase;database=<database-name>"
    username="username<database-user>"
    password="password<password>"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"
    validationQuery="Selectselect 1"
/>

Oracle

Configuring an Oracle Datasource in Apache Tomcat

...

Code Block
titleOracle Datasource
collapsetrue
<Resource
    name="jdbc/myDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@www.some_server.com@<host>:1521:mysid"
    username="username<database-user>"
    password="password<password>"
    connectionProperties="SetBigStringTryClob=true"
    maxActive="25"
    maxIdle="5"
    maxWait="10000"
    validationQuery="Selectselect 1 from DUAL"
/>

MySQL

Configuring a MySQL Datasource in Apache Tomcat

...

Code Block
titleMySQL Datasource
collapsetrue
<Resource name="jdbc/myDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost<host>/mydatabase?autoReconnect=true"
    username="username<database-user>"
    password="password<password>"
    maxActive="25"
    maxIdle="5"
    maxWait="10000"
    validationQuery="Selectselect 1"
/>

PostgreSQL

Configuring a PostgreSQL Datasource in Apache Tomcat

...