I have a small web application at the moment which is in effect a servlet. It supports connecting to 3 different types of database (Oracle, mySQL and MS SQL) as all the SQL statements for each transaction are stored in a file for the chosen database type. In effect a single instance of the application can have user 1 connected to an oracle version of the database while at the same time user 2 is using mySQL and user 3 MS SQL. That never happens in reality but it does mean I only have 1 version of my application which can without change support any of those database platforms. An XML file holds the database connection and type settings and the user selects which database he/she wants to connect to during the logon process.
So - if I wanted to embrace modern frameworks like Spring for example - would it be possible provide that kind of flexibility.
From most of my googling it seems that frameworks assume your going to pick a single type of database and use hibernate to generate the schema code etc.
Any feedback / experience which could lead me in the right direction would be most helpful.
Hibernate (and other ORM solutions like JPA) can connect to multiple persistence providers from within the same code. They don't care about what kind of DB those providers represent, as long as the DBs are supported by the ORM mechanism (which all the major DBs, those you mentioned and the rest, are).