SpringjdbcTempete的配置文件

来源:互联网 发布:沥青库存数据 编辑:程序博客网 时间:2024/06/06 13:06
<?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">


        <!--数据源的配置 -->
      <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
         <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
         <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>
        <property name="username" value="scott"></property>
         <property name="password" value="tiger"></property>
     </bean>
  
  
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">  
        <property name="dataSource"><ref bean="dataSource" /></property>  
    </bean>  
      


    <bean id="stuDao" class="com.legend.ZipFileDemo">
       <property name="jdbcTemplate" ref="jdbcTemplate" />
    </bean>
    
</beans>
0 0
原创粉丝点击