spring 中有一个类叫
org.springframework.orm.ibatis.SqlMapClientFactoryBean
配置如下
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<description>
iBATIS SQL Mapping配置文件名,系统要能够在CLASSPATH中找到该文件
</description>
<value>sqlmap-config.xml</value>
</property>
</bean>
而在sqlmap-config.xml中则是存放其它的需要的配置文件资源
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings cacheModelsEnabled="true"
enhancementEnabled="false"
lazyLoadingEnabled="false"
maxRequests="3000"
maxSessions="3000"
maxTransactions="3000"
useStatementNamespaces="false"/>
<sqlMap resource="sqlmap-mapping-mailmanage.xml"/>
</sqlMapConfig>
使用的时候,我们只要继承SqlMapClientDaoSupport
那么.就可以在代码中.
getSqlMapClientTemplate().queryForList(sqlStmID,param);
org.springframework.orm.ibatis.SqlMapClientFactoryBean
配置如下
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<description>
iBATIS SQL Mapping配置文件名,系统要能够在CLASSPATH中找到该文件
</description>
<value>sqlmap-config.xml</value>
</property>
</bean>
而在sqlmap-config.xml中则是存放其它的需要的配置文件资源
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings cacheModelsEnabled="true"
enhancementEnabled="false"
lazyLoadingEnabled="false"
maxRequests="3000"
maxSessions="3000"
maxTransactions="3000"
useStatementNamespaces="false"/>
<sqlMap resource="sqlmap-mapping-mailmanage.xml"/>
</sqlMapConfig>
使用的时候,我们只要继承SqlMapClientDaoSupport
那么.就可以在代码中.
getSqlMapClientTemplate().queryForList(sqlStmID,param);