Announcement Announcement Module
Collapse
No announcement yet.
how to use two databases with one web application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use two databases with one web application

    Hi

    I am using spring framework with hibernate. I have to use two databases with a single web application. I m not getting any idea how can I do this.......can any one help me

  • #2
    Create multiple datasource beans.

    Any controller or DAO that extends JdbcDaoSupport can only use one connection through its JdbcTemplate (retrieved via getJdbcTemplate()), but you can define your extra instances of JdbcTemplate that use whatever datasource you want. You can then inject those JdbcTemplates into any beans you wish to.

    Comment


    • #3
      hey thanx...........it worked

      Comment

      Working...
      X