O'Reilly logo

Apache Tomcat 7 Essentials by Tanuj Khare

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparison of the datasource for common databases

Until now, we have seen how the datasource is configured on different databases. Let's quickly compare and find out what are the different syntaxes for each database:

  • Oracle: The following mentioned code describes the datasource parameter for the Oracle database:
    <Resource name="jdbc/tomcat7" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@127.0.0.1:1521:test" description="test database for tomcat 7" username="admin" password="admin" maxActive="20" maxIdle="10" maxWait="-1"/>
    
    
  • MySQL: The following mentioned code describes the datasource parameter for the MySQL database:
    <Resource name="jdbc/tomcat7" auth="Container" type="javax.sql.DataSource" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required