标签:bean ble object ever data name gre res div
打开tomcat目录下的conf目录,编辑sever.xml目录。在<GlobalNamingResources>标签中添加数据源配置:
<Resource name="jdbc/dbsourse" scope="Shareable" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" url="jdbc:oracle:thin:@172.16.200.9:1521:orcl" driverClassName ="Oracle.jdbc.driver.OracleDrive" username="username" password="password" />
编辑同目录下的context.xml。 在<Context> 标签中添加数据源连接:
<ResourceLink global="jdbc/dbsourse" name="jdbc/dbsourse" type="javax.sql.DataSource" />
<bean id="dataSource" name="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/jdbc/dbsourse" /> </bean>
标签:bean ble object ever data name gre res div
原文地址:http://www.cnblogs.com/Leechg/p/6873443.html