参考网上很多写法:
web.xml
<res-ref-name>jdbc/oscdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
ibm-web-bnd.xml配置
ibm-web-bnd.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-bnd
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd"
version="1.0">
然后在spring中定义
<bean id="dataSourceOracle"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="jdbc/oscdb"/>
<property name="lookupOnStartup"
value="false"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
我的jndi名称:jdbc/oscdb 部署was启动不报错,但是到了