Menu

Differenct DB connection

2004-07-14
2004-07-19
  • Nobody/Anonymous

    Hello,

    What should I do if I'd like to connect to more than one DB at the same time since I need to retrieve data from another DB?

    Thank you for your time.

    Alan
    Jul 14

     
    • Richard Banks

      Richard Banks - 2004-07-19

      Hi Alan,

      In the XML mapping file you simply need to define two <database .../> entries.  Just make sure the name attribute for each entry is unique.

      In your class mappings simply set the database reference to the appropriate name.

      eg <class name="someclass" database="DB1"... />

      Note that some cross database joins may not work properly if the databases are stored on different servers.  It depends on the abilities of the SQL server and your local configurations.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.