views:

1231

answers:

2

The iBatis framework has been significantly tweaked between versions 2 & 3, so much that even the config file (now often referred to as MapperConfig.xml) is different.

That being said, there are lots of examples online on how to create a JDBC connection pool with iBatis, but I couldn't find one example on how to do it with JNDI. There is an updated user guide at: http://svn.apache.org/repos/asf/ibatis/java/ibatis-3/trunk/doc/en/iBATIS-3-User-Guide.pdf which does refer to the JNDI settings on page 19, but I still couldn't it get it correctly communicate with the database.

A working example of a JDNI (container managed connection pool) in iBatis 3 would be greatly appreciated!!

+1  A: 

Assuming you've already got a JNDI database resource set up, the following environment for iBatis 3's configuration XML file works for me (running on Tomcat):

<environment id="development">
    <transactionManager type="JDBC"/>
    <dataSource type="JNDI">
        <property name="data_source" value="java:comp/env/jdbc/webDb"/>
    </dataSource>
</environment>
Brian Showalter
that's exactly what I did too but with no success. What I eventually found out is there there's some specific "weblogic'ness" that needs to be done above this to make it work.
Stephane Grenier
It appears to have to do with the classpath. Basically you have to set weblogic to load your webapps librairies (jars) before weblogic's own.
Stephane Grenier
A: 

Can someone tell me what the "value" should be for weblogic using ibatis 3 or mybatis 3?