tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Thomerson" <>
Subject Re: Avoid duplication of database settings
Date Thu, 12 Jan 2006 03:24:34 GMT
Yes - Spring would be very handy for your usage.  You can configure your 
your entire middle tier (services and persistence) within your Spring 
configuration, and then share it between the multiple clients.  You can then 
inject the services into various objects, or pull them from a global 
singleton-like application context.  You can also use it to help you 
configure things like internationalization.  I'd highly recommend a Spring / 
Hibernate combo, or even just Spring if you already have a persistence layer 
you don't want / need to change.

Jeremy Thomerson

----- Original Message ----- 
From: "Fredrik Rubensson" <>
To: "Tomcat Users List" <>
Sent: Tuesday, January 10, 2006 4:17 AM
Subject: Re: Avoid duplication of database settings

Sorry about the "antispammed" subject in my previous post.

>>> I have an application consisting of a web application and some stand
>>> alone java clients. Both the web application and the java clients
>>> a database. The problem is that the database configuration is
>>> duplicated.
>> If you are doing it the ant way I recommend using filtering.
> Thanks for the suggestion. I will have a look at it.
>Do you know if frameworks like Spring or Hibernate solves this kind of

I don't know about spring but in hibernate there is one configuration
file that you can share between webapp and standalone clients. (Using it
in my current project.) If you only use Hibernate to access your
database you will be fine. It is also possible to get the DataSource
from the hibernate configuration if you want to access the database
directly (for performance reasons). I have some SQL scripts that need
the database info so I use filtering anyway both as a way to have the
configuration values in one place and as a way to easily build for
different environments.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message