Name jdbc is not bound in this Context
  包数据库连接出错误

解决方案 »

  1.   

    jdbc没有绑定,检查一下你的dirverurl
      

  2.   


    web.xml
    <resource-ref>
    <res-ref-name>DBNAME</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    在tomcat中配置如下:
    <Context path="/工程名">
    <Resource name="DBNAME"
    type="javax.sql.DataSource"
    username="root"
    password="xxxx"
    driverClassName="com.mysql.jdbc.Driver"
    maxIdle="10"
    url="jdbc:mysql://localhost:3306/DBNAME"
    maxActive="10"/>
    </Context>
      

  3.   


    web.xml
    <resource-ref>
    <res-ref-name>DBNAME</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    在tomcat中配置如下:
    <Context path="/工程名">
    <Resource name="DBNAME"
    type="javax.sql.DataSource"
    username="root"
    password="xxxx"
    driverClassName="com.mysql.jdbc.Driver"
    maxIdle="10"
    url="jdbc:mysql://localhost:3306/DBNAME"
    maxActive="10"/>
    </Context>
      

  4.   

    context是上下文意思,也就是指这个mysql的运行环境,也就这个mysql的配置问题