Results 1 to 5 of 5

Thread: Petclinic Database Setup--JNDI connection-pool with Tomcat

  1. #1
    Join Date
    Feb 2005
    Posts
    8

    Default Petclinic Database Setup--JNDI connection-pool with Tomcat

    Hi
    I am testing The Spring Petclinic Application with mysql database, it is ok with the Local DataSource with Spring's DriverManagerDataSource. However, I want to use a JNDI connection-pooled datasource which is essential to real production apps. I am not clear how is such a data source configured.

    The Petclinic documentation has the following statement:
    To use a J2EE server supplied connection-pooled data source with Tomcat, it will be necessary to use and possibly edit the appropriate context definition file for the petclinic webapp. To use it, deploy a copy of the appropriate context definition file in Tomcat's webapps directory and restart the server. Consult the Tomcat log files if something goes wrong when starting either Tomcat or the Petclinic application. The context files are named petclinic_tomcat_*.xml...

    I am not sure what "Tomcat's webapps directory" means (Tomcat /webapps? ) and what other configurations should be made in e.g. web.xml, applicationContext-jdbc.xml. Or should the contents of petclinic_tomcat_mysql.xml be copied to Tomcat /conf/server.xml?

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    for more information on configuring datasources with tomcat, please take a look at JNDI Datasource HOW-TO.
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Feb 2005
    Posts
    8

    Default

    Thanks a lot!

    I tried to copy the context entity from petclinic_tomcat_mysql.xml into tomcat/config/server.xml, and still not work.

    what i want is a JNDI DataSource for J2EE environments specified in the applicationContext.xml file for the following data source bean:

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName"><value>java:comp/env/jdbc/petclinic</value></property>
    </bean>

    I wonder if any body have tested the Petclinic application with a JNDI connection-pool.

  4. #4
    Join Date
    May 2005
    Posts
    6

    Default

    hi,
    I also have the same problem as yours. And I try the "JNDI Datasource HOW-TO", it's fine, I thought since the they implemented in different ways.
    BTW, have found the solution?

    Cheers!

  5. #5
    Join Date
    Feb 2005
    Posts
    8

    Default

    yes i got the solution thanks.

    it is a matter of the directory to put the tomcat configure file

    cheers

Similar Threads

  1. Replies: 2
    Last Post: Nov 22nd, 2006, 01:38 PM
  2. Replies: 2
    Last Post: Jun 22nd, 2005, 11:43 PM
  3. Database Connection Not Released
    By pcheung in forum Data
    Replies: 2
    Last Post: Mar 18th, 2005, 09:19 AM
  4. Replies: 2
    Last Post: Jan 1st, 2005, 01:15 PM
  5. Replies: 5
    Last Post: Dec 22nd, 2004, 08:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •