Results 1 to 3 of 3

Thread: how to use two databases with one web application

  1. #1
    Join Date
    May 2009
    Posts
    3

    Default 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. #2
    Join Date
    Apr 2006
    Location
    South Carolina
    Posts
    122

    Default

    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.

  3. #3
    Join Date
    May 2009
    Posts
    3

    Default

    hey thanx...........it worked

Posting Permissions

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