JDBC 连接池(配置web.xml)

JDBC 连接池(配置web.xml)

下面是对web.xml的配置

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

 <resource-ref>
      <description>DB Connection</description>
//res-ref-name 这里也是你的JNDI名字 但是要注意必须和你前面的JNDI的名字一样才可以(server.xml的JNDI名字相同)
      <res-ref-name>jdbc/bbs</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>  

</web-app>

你可能感兴趣的:(JDBC 连接池(配置web.xml))