Hello,
This is my datasource information in tomcat server's context.xml
<Resource name="jdbc/xxx" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@host:port:schema"
username="yyy" password="****" maxActive="20" maxIdle="10"
maxWait="-1"/>
this is how I refer it in web.xml
<resource-ref>
<description>DB</description>
<res-ref-name>jdbc/xxx</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In the below lines of jpaContext.xml, I need to refer to the above mentioned JNDI from context.xml, instead of directly writing the username/password and database name(as I did)
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver " />
<property name="url" value="jdbc:oracle:thin:@host:port:schema" />
<property name="yyy" value="decom" />
<property name="password" value="***" />
</bean>