ibatis+Spring框架集成

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
 default-autowire="byName" default-lazy-init="true">

 <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
  <property name="jndiName">
   <value>java:comp/env/Friend365.cn</value>
  </property>
 </bean>

 <bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" />  

 <bean id="sqlMapClient"
  class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  <property name="configLocation">
   <value>classpath:map-config.xml</value>
  </property>
  <property name="dataSource" ref="dataSource" />
  <property name="lobHandler" ref="lobHandler"/>
 </bean>

 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
 </bean>

</benas>



[本日志由 51itcn 于 2010-04-04 01:26 PM 编辑]
文章来自: 本站原创
Tags: 查看次数: 293
发表评论
你没有权限发表留言!