<!-- 定义数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@192.168.1.100:1521:ORCL" />
<property name="username" value="zengfan" />
<property name="password" value="zengfan" />
</bean>
<!-- 注入数据源到sqlMapClient -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:sqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 在dao注入sqlMapClient -->
<bean id="dao" class="com.jquery.dao.impl.BookDAO">
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
<bean id="service" class="com.jquery.service.impl.BookService">
<property name="bookDAO" ref="dao" />
</bean>
<bean name="/query" class="com.jquery.action.QueryBookAction">
<property name="bookService" ref="service" />
</bean>
[quote][/quote]
spring2.5+ibatis+oracle
最新推荐文章于 2019-01-28 17:29:18 发布