alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Spring Framework example source code file (petclinic_tomcat_mysql.xml)

This example Spring Framework source code file (petclinic_tomcat_mysql.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Spring Framework tags/keywords

context, define, driver, jdbc, jdbc, logger, mysql, mysql, resource, resourceparams, resourceparams, the, the, utf-8

The Spring Framework petclinic_tomcat_mysql.xml source code

<?xml version="1.0" encoding="UTF-8" ?>

<Context path="/petclinic" docBase="petclinic" debug="4" reloadable="true">
  <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_petclinic_log." suffix=".txt" timestamp="true"/>

  <!-- Define a database connection pool for MYSQL -->
  <Resource name="jdbc/petclinicMYSQL" auth="Container" type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/petclinicMYSQL">
    <parameter>
      <name>factory
      <value>org.apache.commons.dbcp.BasicDataSourceFactory
    </parameter>
    
    <parameter>
      <name>driverClassName
      <value>org.gjt.mm.mysql.Driver
    </parameter>
    <!--
          The JDBC connection url for connecting to your MySQL dB.
          The autoReconnect=true argument to the url makes sure that the
          mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
          connection.  mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
      <name>url
      <value>jdbc:mysql://localhost:3306/petclinic?autoReconnect=true
    </parameter>
    <parameter>
      <name>username
      <value>pc
    </parameter>
    <parameter>
      <name>password
      <value>pc
    </parameter>
    
    <parameter>
      <name>maxActive
      <value>50
    </parameter>
    <parameter>
      <name>maxIdle
      <value>10
    </parameter>
    <parameter>
      <name>maxWait
      <value>10000
    </parameter>
    <parameter>
      <name>removeAbandoned
      <value>true
    </parameter>
    <parameter>
      <name>removeAbandonedTimeout
      <value>60
    </parameter>
    <parameter>
      <name>logAbandoned
      <value>true
    </parameter>
  </ResourceParams>

  
</Context>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework petclinic_tomcat_mysql.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.