使用JDBCTemplate实现与Spring结合,方法公用 ——Spring配置(applicationContext.xml)

来源:互联网 发布:天蝎网络第二季看不到 编辑:程序博客网 时间:2024/06/04 19:05
<?xml version="1.0" encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.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:@127.0.0.1:1521:orcl"></property><property name="password" value="123"></property><property name="username" value="pro"></property></bean><bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"><property name="dataSource" ref="dataSource"></property></bean><bean id="baseDao" class="org.dao.impl.EmpDaoImpl"><property name="jdbcTemplate" ref="jdbcTemplate"></property></bean></beans>

阅读全文
1 0
原创粉丝点击