ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: How to use tomcat's naming-factory-dbcp.jar
Date Fri, 21 Oct 2005 08:14:06 GMT
Ok, then you probably have to write your own transactionmanager and put
the following in your SQLMap config.xml:

<transactionManager type="mypackage.TomcatDbcpTransactionConfig">
  <dataSource type="mypackage.TomcatDbcpDataSourceFactory">
    <property name="prop1" value="value1"/>
    <property name="prop2" value="value2"/>
  </dataSource>
</transactionManager>

This requires implementations of:
- com.ibatis.sqlmap.engine.transaction.TransactionConfig (extend
com.ibatis.sqlmap.engine.transaction.BaseTransactionConfig)
- com.ibatis.sqlmap.engine.datasource.DataSourceFactory

Maybe there is some documentation at the Tomcat-site about the
DBCP-package, I suspect it is almost a copy of the DBCP-implementation.

Not sure if this is the preferred way to go though, I don't know if your
datasources would be accessible in Tomcat too.

Hope this helps,

Niels

-----Original Message-----
From: Zsolt [mailto:zkoppanylist@intland.com] 
Sent: vrijdag 21 oktober 2005 10:05
To: user-java@ibatis.apache.org
Subject: RE: How to use tomcat's naming-factory-dbcp.jar

Thank you Niels, but I would like configure the database connection in
sqlmap-config.xml. Because we ship our application with tomcat it would
be
easier if we could configure ibatis to use naming-factory-dbcp.jar that
is
always there.

Zsolt


>-----Original Message-----
>From: Niels Beekman [mailto:n.beekman@wis.nl]
>Sent: Friday, October 21, 2005 9:16 AM
>To: user-java@ibatis.apache.org
>Subject: RE: How to use tomcat's naming-factory-dbcp.jar
>
>You should reference the datasources defined in Tomcat using JNDI, this
>can be found in the documentation.
>
>Niels
>
>-----Original Message-----
>From: Zsolt [mailto:zkoppanylist@intland.com]
>Sent: vrijdag 21 oktober 2005 9:15
>To: user-java@ibatis.apache.org
>Subject: How to use tomcat's naming-factory-dbcp.jar
>
>Hi,
>
>I use tc-5.5.12 and that is shipped with naming-factory-dbcp.jar. It
>looks
>like it has new class names such as:
>org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
>
>How do I have to configure sqlmap-config.xml to use this library?
>
>Zsolt
>
>



Mime
View raw message