<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<!--使用本机的数据库-->
<bean id="springDSN"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
<property name="url" value="jdbc:oracle:thin:@192.168.14.203:1521:orcl"></property>
<property name="username" value="pfdacs"></property>
<property name="password" value="pfdacs123"></property>
</bean><!--
<bean id="springDSN"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url" value="jdbc:oracle:thin:@192.168.14.203:1521:orcl">
</property>
<property name="username" value="pfdacs"></property>
<property name="password" value="pfdacs123"></property>
</bean>
--><!--使用weblogic的数据源-->
<!--
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean"> <property
name="jndiName" value="jdbc/DACS" /> </bean>
-->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"
abstract="false" lazy-init="false" autowire="default"
dependency-check="default">
<property name="dataSource">
<!--使用本机的数据库-->
<ref bean="springDSN" />
<!--使用weblogic的数据源-->
<!--<ref bean="springDSN" />
-->
</property>
</bean>
<bean id="crmUserDao" class="cn.ffcs.intf.noCrmUser.dao.Impl.CrmUserDaoImpl">
<property name="jdbcT" ref="jdbcTemplate" />
</bean>
</beans>
spring的数据库配置
最新推荐文章于 2024-07-25 12:51:22 发布