Announcement Announcement Module
Collapse
No announcement yet.
how to support many database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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....

      Comment

      Working...
      X