You need to add the binding in ibm-web-bnd.xml:
<resource-ref name="jdbc/mydb" binding-name="jdbc/jndi" />
jdbc/jndi: You will configure jndi in websphere admin console,
Reference name: resource-ref name should match with res-ref-name
<resource-ref>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
You should also make sure that <web-app version of web.xml file should be 2.5 or up and use schema not dtd. If you use older version of J2EE you have to use ibm-web-bnd.xmi file instead of xml.
<resource-ref name="jdbc/mydb" binding-name="jdbc/jndi" />
jdbc/jndi: You will configure jndi in websphere admin console,
Reference name: resource-ref name should match with res-ref-name
<resource-ref>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
You should also make sure that <web-app version of web.xml file should be 2.5 or up and use schema not dtd. If you use older version of J2EE you have to use ibm-web-bnd.xmi file instead of xml.
No comments:
Post a Comment