ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Henrique Ferreira e Silva <dhsi...@gmail.com>
Subject Re: dao.xml and sql-map-config.xml
Date Fri, 24 Jun 2005 17:04:51 GMT
Hi Folashade,

There is the SQLMAP transaction manager you can use to integrate your
DAO with SqlMaps. I recommend also to use the template class to
implement your DAOs, SqlMapDaoTemplate. It will make available,
through getSqlMapExecutor() method, the sql maps layer.

You can find more information on this regard reading the iBATIS DAO guide.

Hope that helped,
Daniel Silva.

On 6/23/05, Folashade Adeyosoye <shardayyy@gmail.com> wrote:
> 
> 
> Here is my question relating to configuration.
> 
>  
> 
> I know in the dao.xml and sql-map-config.xml should look like the ones
> below, but do I have to also define a transactionManager type="JDBC" in the
> SQL-MAP-CONFIG.XML and just stick to the one in the DAO.XML, I t think they
> might be doing the same thing, and if there is a need to change the 
> "<properties
> resource="net/naijatek/fgconline/properties/database_dev_local.properties"/>",
> I would have to change them in both places.
> 
>  
> 
>  
> 
> Thanks
> 
> Shardayyy
> 
>  
> 
>  
> 
>  
> 
> ======================= SQL-MAP-CONFIG.XML
> ==============================================
> 
>  
> 
> <sqlMapConfig>
> 
>  
> 
>   <properties
> resource="net/naijatek/fgconline/properties/database_dev_local.properties"/>
> 
>  
> 
>  
> 
>   <settings
> 
>     cacheModelsEnabled="true"
> 
>     enhancementEnabled="true"
> 
>     maxSessions="64"
> 
>     maxTransactions="8"
> 
>     maxRequests="128"/>
> 
>  
> 
>   <transactionManager type="JDBC">
> 
>     <dataSource type="SIMPLE">
> 
>       <property value="${driver}" name="JDBC.Driver"/>
> 
>       <property value="${url}" name="JDBC.ConnectionURL"/>
> 
>       <property value="${username}" name="JDBC.Username"/>
> 
>       <property value="${password}" name="JDBC.Password"/>
> 
>       <property value="15" name="Pool.MaximumActiveConnections"/>
> 
>       <property value="15" name="Pool.MaximumIdleConnections"/>
> 
>       <property value="1000" name="Pool.MaximumWait"/>
> 
>     </dataSource>
> 
>   </transactionManager>
> 
>  
> 
>  
> 
>   <sqlMap
> resource="net/naijatek/fgconline/persistence/sqlmapdao/sql/Member.xml"/>
> 
>   <sqlMap
> resource="net/naijatek/fgconline/persistence/sqlmapdao/sql/PrivateMessage.xml"/>
> 
>   <sqlMap
> resource="net/naijatek/fgconline/persistence/sqlmapdao/sql/SelectionObject.xml"/>
> 
>   <sqlMap
> resource="net/naijatek/fgconline/persistence/sqlmapdao/sql/SystemTask.xml"/>
> 
>   <sqlMap
> resource="net/naijatek/fgconline/persistence/sqlmapdao/sql/AnnAndAdv.xml"/>
> 
>  
> 
> </sqlMapConfig>
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> ========= DAO.XML =======================
> 
> <daoConfig>
> 
>  
> 
> <properties
> resource="net/naijatek/fgconline/properties/database_dev_local.properties"/>
> 
>  
> 
>   <context>
> 
>  
> 
>    <transactionManager type="JDBC">
> 
>       <property name="DataSource" value="SIMPLE"/>
> 
>       <property name="JDBC.Driver" value="${driver}"/>
> 
>       <property name="JDBC.ConnectionURL" value="${url}"/>
> 
>       <property name="JDBC.Username" value="${username}"/>
> 
>       <property name="JDBC.Password" value="${password}"/>
> 
>       <property name="JDBC.DefaultAutoCommit" value="true"/>
> 
>       <property name="Pool.MaximumActiveConnections" value="15"/>
> 
>       <property name="Pool.MaximumIdleConnections" value="15"/>
> 
>       <property name="Pool.MaximumCheckoutTime" value="120000"/>
> 
>     </transactionManager>
> 
>  
> 
> <!--   YES IT IS COMMENTED OUT, THIS IS MY OTHER IMPLEMENTATION
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.MemberDAO"
> implementation="net.naijatek.fgconline.persistence.jdbcsql.MysqlMemberDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.SelectionObjectDAO"
> implementation="net.naijatek.fgconline.persistence.jdbcsql.MysqlSelectionObjectDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.AnnAndAdvDAO"
> implementation="net.naijatek.fgconline.persistence.jdbcsql.MysqlAnnAndAdvDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.PrivateMessageDAO"
> implementation="net.naijatek.fgconline.persistence.jdbcsql.MysqlPrivateMessageDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.SystemTasksDAO"
> implementation="net.naijatek.fgconline.persistence.jdbcsql.MysqlSystemTasksDAO"/>
> 
> -->
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.MemberDAO"
> implementation="net.naijatek.fgconline.persistence.sqlmapdao.IbatisMemberDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.SelectionObjectDAO"
> implementation="net.naijatek.fgconline.persistence.sqlmapdao.IbatisSelectionObjectDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.AnnAndAdvDAO"
> implementation="net.naijatek.fgconline.persistence.sqlmapdao.IbatisAnnAndAdvDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.PrivateMessageDAO"
> implementation="net.naijatek.fgconline.persistence.sqlmapdao.IbatisPrivateMessageDAO"/>
> 
>     <dao
> interface="net.naijatek.fgconline.persistence.iface.SystemTasksDAO"
> implementation="net.naijatek.fgconline.persistence.sqlmapdao.IbatisSystemTasksDAO"/>
> 
>  
> 
>   </context>
> 
> </daoConfig>

Mime
View raw message