You can programmatically make entitymanagers. You don't need to use jdbc.
Here's a link about custom repositories. spring custom repo link
I would try adding a functionality to switch out the entitymanager. You could store the user's db persistence info in a file or a database if there will be alot of configurations.