ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janet Li <lil_foo...@yahoo.com>
Subject Multiple database connections
Date Mon, 05 Feb 2007 17:57:26 GMT

I am currently using iBatis 2.1 and I am having trouble connecting to different dbs.  In my
DAOMap.xml, I created to connections to 2 different databases -- when I tested each of the
queries in Junit, it works fine, however when I call via the DaoManager, it keeps throwing
this error:

javax.servlet.ServletException: Servlet execution threw an exception

root cause


This is my DAOMap.xml:
<context id="sqlmap">
        <transactionManager type="SQLMAP">
            <property name="SqlMapConfigResource" value="com/ze/security/config/sql-map-config.xml"/>
        <dao interface="com.ze.security.dao.IApplicationDao" implementation="com.ze.security.dao.sqlmap.SqlMapApplicationDao"
    <context id="sqlmapUtl">
        <transactionManager type="SQLMAP">
            <property name="SqlMapConfigResource" value="com/ze/security/config/utl_sql-map-config.xml"/>
            <dao interface="com.ze.security.dao.IHolidayDao" implementation="com.ze.security.dao.sqlmap.SqlMapHolidayDao"

This is where it throws the exception:
 final Reader reader = Resources
      daoManager = DaoManagerBuilder.buildDaoManager(reader);

If I remove one of the context, it works.  Can anyone help?  Thanks.

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
View raw message