Feb 20th, 2007, 08:33 AM
Application supporting many databases
Note: This is not a question directly related to spring.
I'm developing a webapp using spring/spring mvc. I am asked to build it in a way to be able to support many different database servers (currently SQL Server and MySQL). I will be using hibernate, so the syntax of SQL queries is not an issue. What concerns me is the database schema creation.
Is there a strategy to get me going? I will only be using very simple database features (indexes, FKs and auto incremented primary keys).
How do you guys do it? I'd like to avoid having to maintain 2 (or more) SQL files for database schema creation.
Feb 20th, 2007, 08:42 AM
Hibernate can create the schema for you. Have a look at the Hibernate tools section of the website.
Feb 21st, 2007, 01:53 AM
Thanks for you reply.
Is there any other way? I'd like to be generating the first schema by hand (using a database client tool) if possible.
Feb 21st, 2007, 02:33 AM
One of the options to to output it to a file, isn't this enough?
Feb 21st, 2007, 03:15 AM
This worked exceptionally well.
Thank you very much!
Feb 21st, 2007, 03:21 AM
Not a problem, glad you found it useful. I've not used the Hibernate tools much but they do look pretty good!