Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to delay hibernate connection from application startup in web app

Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I have a rather unique (I think) problem. Currently we have a java web application and hibernate objects are being loaded through the web.xml

This works great because hibernate gets loaded when the web app starts up. The problem is now we would like hibernate to not start until after the user has entered the database username and password credentials, inside the web application. How can I stop hibernate from starting until this has happened?

I think I will have to remove the spring-hibernate, datasource, etc from the web.xml, but how to I get the spring container to load those files later (after the web app is running) and pass in the username and password dynamically instead of having them static in the xml files?

I hope this made sense to someone :-). Please ask questions if you have any.


Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can start Hibernate any time you want to. See the documentation.
Trust God, but always tether your camel... to this tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic