Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javax.naming.NameNotFoundException: Name comp/env/jdbc not found in co

Status
Not open for further replies.

davinia1

Programmer
Jul 2, 2004
12
ES
Any idea, please? :(

This is my code:

java.util.Properties parms = new java.util.Properties();
parms.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");

Context ctx = new InitialContext(parms);

DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/OracleSample");

Thanks in advance.
 
What was the issue - just in case anyone else has the same problem.
 
I wrote the same code but:
DataSource ds = (DataSource)ctx.lookup("jdbc/OracleSample");

Connection conn = (Connection) ds.getConnection("user","password");

In JDBC Provider List:
Implementation class name:
oracle.jdbc.pool.OracleConnectionPoolDataSource


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top