基本的:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
abstract="false" singleton="true" lazy-init="default"
autowire="default" dependency-check="default">
<property name="driverClassName"><value>oracle.jdbc.OracleDriver</value></property>
<property name="url"><value>jdbc:oracle:thin:@10.240.144.11:1521:XYMES</value></property>
<property name="username"><value>reel</value></property>
<property name="password"><value>reel</value></property>
</bean>
</beans>
使用Tomcat 連接池的:
<bean id="tomcatDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/REEL1</value>
</property>
</bean>