Usually a web application has a one-to-one mapping of a database account. But in my application I have to ask the database user and password at the very first page that loads. In this case I cannot load Spring with JPA at the time of the application startup. I have to do it once the user successfully provided the database user and password. In other words, Spring and all other frameworks are designed to load everything at application startup, but I don't want to do that.
This application requires each user to specify userid
and password
. If the user is authenticated I want to use same database connection for the rest of configuration of Spring and JPA.
Your help is highly appreciated.