spring2.5+ibatis+oracle

<!-- 定义数据源 -->

 <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>

你可能感兴趣的:(DAO,jquery,oracle,bean,ibatis)