Results 1 to 6 of 6

Thread: Application supporting many databases

  1. #1
    Join Date
    Oct 2006
    Location
    Athens, Greece
    Posts
    5

    Default Application supporting many databases

    Hello

    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.

    many thanks

  2. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Hibernate can create the schema for you. Have a look at the Hibernate tools section of the website.
    http://www.hibernate.org/hib_docs/v3...oolsetguide-s1

  3. #3
    Join Date
    Oct 2006
    Location
    Athens, Greece
    Posts
    5

    Default

    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.

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    One of the options to to output it to a file, isn't this enough?
    --output=my_schema.ddl

  5. #5
    Join Date
    Oct 2006
    Location
    Athens, Greece
    Posts
    5

    Default

    This worked exceptionally well.

    Thank you very much!

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Not a problem, glad you found it useful. I've not used the Hibernate tools much but they do look pretty good!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •