[ACCEPTED]-javax.naming.NameNotFoundException: Name jdbc is not bound in this Context-tomcat6

Accepted answer
Score: 14

Your problem is that you need to prefix 2 your jndi string with java:/comp/env

So in 1 your case try:

DataSource ds = (DataSource)envContext.lookup("java:/comp/env/jdbc/myoracle");

That should solve the problem.

Score: 0

I also come across with this problem, but 2 in my case I've fixed by adding bellow line:

<ResourceLink global="jdbc/myoracle" name="jdbc/myoracle" type="oracle.jdbc.pool.OracleDataSource"/>

to 1 tomcat conf file -> context.xml.

Score: 0

Try just "java:"

(DataSource) context.lookup("java:jdbc/myoracle");


More Related questions