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" ...

Get Apache Tomcat 7 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.