你的web.xml中还要对Resource进行引用
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/quickstart</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
你需要在web.xml中的<web-app></web-app>
中加入这个
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/quickstart</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
你需要在web.xml中的<web-app></web-app>
中加入这个
要在自己的web应用中引用Resource!
这点很重要!
要不,你只是定义了,却没有引用,那就等于白弄了~
呵呵~