File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate - Database IP changes daily Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate - Database IP changes daily" Watch "Hibernate - Database IP changes daily" New topic
Author

Hibernate - Database IP changes daily

Kim Lilienfeld
Greenhorn

Joined: Apr 13, 2004
Posts: 25
Hi

I'm currently in the situation where I am writing an app for a client whose current database changes IP daily. Basically, they have 2 databases of identical structure but all their data is obtained from an import provided by another company (due to security restrictions they can't access the source database). In order to prevent the situation of having no data for a day if the import fails, they have set up the 2 databases on 2 servers which they work from. There is a separate constant database which holds the ip of the current database.

Now I am developing an app for them using Hibernate as the persistence layer but have no idea how to set it up so Hibernate is always pointing to the correct database. Does anyone have any idea how I can configure this and then reload hibernate's configuration every day (or even every hour if necessary) to point to the latest database.

Any help/ideas would be appreciated.

Thanks,
Kim
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Well anything that you configure in the xml files you can also configure programatically. So in code then you can do some logic that figures out the IP for the day, then programatically set that up in the Configuration object.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Hibernate - Database IP changes daily
 
Threads others viewed
ip addresses
How to backuping data by using Hibernate?..
Configuring for testing
Is Hibernate is DB dependent or Independent?
advise regarding putting the data in application scope
IntelliJ Java IDE