<!-- 通过JNDI配置DataSource --> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/jboa</value> </property> </bean>
在tomcat下的context.xml添加--数据库连接
<Resource name="jdbc/jboa" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" username="bdqn" password="bdqn" maxActive="20" maxIdle="10" />