Results 1 to 3 of 3

Thread: how to support many database

  1. #1
    Join Date
    Apr 2008
    Location
    spain
    Posts
    21

    Default how to support many database

    hi

    is there a way to support many database with spring without using orm?
    some client use mysql and some other will use oracle (not in the same time)?

    how to manage dao to support many database?

    thanks

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    is there a way to support many database with spring without using orm?
    Yes, with Spring's JdbcTemplate or MyBatis. You can use even both

    some client use mysql and some other will use oracle (not in the same time)?
    Yes, just create two differents dataSource beans.

    how to manage dao to support many database?
    check 11. Transaction Management


    but be aware, if you need both DB in the same Spring Transaction control, you must use JtaTransactionManager
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3
    Join Date
    Apr 2008
    Location
    spain
    Posts
    21

    Default

    Quote Originally Posted by dr_pompeii View Post
    Hello


    Yes, with Spring's JdbcTemplate or MyBatis. You can use even both


    Yes, just create two differents dataSource beans.


    check 11. Transaction Management


    but be aware, if you need both DB in the same Spring Transaction control, you must use JtaTransactionManager
    before i see some bench, i wanted to use mybatis, but jdbctemplate is faster
    how i will say to spring witch datasource to use? also i will need to send this info to an abstract factory who will switch to the good database factory....

Tags for this Thread

Posting Permissions

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