http://localhost:7001/console 控制台,端口可能会变
Service->JDBC->Connection Pools->Configure a new JDBC Connection Pool...
Name: osportal
URL:jdbc:oracle:thin:@localhost:1521:ycweb
Driver Classname:oracle.jdbc.driver.OracleDriver
Properties(key=value):
user=username
password=userpass
dll=ocijdbc8
protocol=thin
保存
JDBC Data Sources:Configure a new JDBC Data Source...
Name: sdyc
JNDI Name:jdbc/sdyc
Pool Name:osportal (和上边的Name保持一致)
将应用复制到DefaultWebApp目录
web.xml中加入
<resource-ref >
<res-ref-name>jdbc/sdyc</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<env-entry>
<env-entry-name>contextConfigLocation</env-entry-name>
<env-entry-value>/WEB-INF/conf/applicationContext.xml</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>