1 配置文件 ibatis-context.xml <?xml version="1.0" encoding="UTF-8"?><beans xmlns="https://www.springframework.org/schema/beans"xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:aop="https://www.springframework.org/schema/aop"xmlns:tx="https://www.springframework.org/schema/tx"xsi:schemaLocation="https://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttps://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop-2.0.xsdhttps://www.springframework.org/schema/txhttps://www.springframework.org/schema/tx/spring-tx-2.0.xsd"><bean id="placeholderConfig"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="location"><value>classpath:db.properties</value></property></bean><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><property name="driverClassName" value="${db.driverClassName}" /><property name="url" value="${db.url}NIHAO" /><property name="username" value="${db.username}" /><property name="password" value="${db.password}" /><property name="initialSize" value="2" /><property name="maxActive" value="20" /><property name="maxWait" value="-1" /><property name="maxIdle" value="10" /><property name="removeAbandoned" value="true" /><property name="removeAbandonedTimeout" value="30000" /><property name="logAbandoned" value="true" /></bean><bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"><property name="sqlMapClient" ref="sqlMapClient"></property></bean><bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"><property name="dataSource" ref="dataSource"></property><property name="configLocation" value="sql-map-config.xml"></property></bean><bean id="ibatisProductDao" class="springapp.repository.IbatisProductDao"><property name="sqlMapClientTemplate" ref="sqlMapClientTemplate"></property></bean></beans><?xml version="1.0" 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交