javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

Posted zhiws

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javax.naming.NameNotFoundException: Name jdbc is not bound in this Context相关的知识,希望对你有一定的参考价值。

在tomcat的context文件里加上数据源,

-->
<Resource validationQuery="select ‘x‘ from dual" testOnBorrow="true" maxWait="5000" maxIdle="2" maxActive="50" password="commu" username="commu" url="jdbc:oracle:thin:@192.168.1.150:1521:orcl" driverClassName="oracle.jdbc.driver.OracleDriver" type="javax.sql.DataSource" name="acc_cm"/>

<Resource validationQuery="select ‘x‘ from dual" testOnBorrow="true" maxWait="5000" maxIdle="2" maxActive="50" password="acc_ic" username="acc_ic" url="jdbc:oracle:thin:@192.168.1.150:1521:orcl" driverClassName="oracle.jdbc.driver.OracleDriver" type="javax.sql.DataSource" name="acc_ic"/>

<Resource validationQuery="select ‘x‘ from dual" testOnBorrow="true" maxWait="5000" maxIdle="2" maxActive="50" password="acc_op" username="acc_op" url="jdbc:oracle:thin:@192.168.1.150:1521:orcl" driverClassName="oracle.jdbc.driver.OracleDriver" type="javax.sql.DataSource" name="acc_op"/>

<Resource validationQuery="select ‘x‘ from dual" testOnBorrow="true" maxWait="5000" maxIdle="2" maxActive="50" password="acc_st" username="acc_st" url="jdbc:oracle:thin:@192.168.1.150:1521:orcl" driverClassName="oracle.jdbc.driver.OracleDriver" type="javax.sql.DataSource" name="acc_st"/>


以上是关于javax.naming.NameNotFoundException: Name jdbc is not bound in this Context的主要内容,如果未能解决你的问题,请参考以下文章