I\'ve seen (and done) data source configuration in two ways (the code below is just for demo):
1) configuration inside persistence units, like:
<
It is strictly personal preference.
My suggestion would be to use Spring's configuration if you are using Spring already. Its purpose is dependency injection and management so let it do its job with respect to your dependency on a database. If, however, you are not already using Spring, stick with the persistence configuration considering that this will keep your project simpler while still functional. I will suggest though that any project that needs Hibernate to interact with a database is probably big enough to condone using Spring within.