I have a spring web application which a user can deploy on their own servers. Once the application is running, the adminstrator can set the database URL and credentials from the front end, and there is no default one set up. I do not know how to do this with spring / hibernate, as my datasource is wired in once the LocalSessionFacytoryBean is created in the initialisation of my spring container.
If your application server supports it and its not to complicated for your users you could use JNDI datasources. They are configurable over the application server, however its not the same as changing them at runtime.
You can build a SessionFactory object with a custom data source at runtime, and use that insted. Nothing stops you from that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With