Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JNDI Connection Pool Problem  RSS feed

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have found various topics on this error when it says
Cannot create JDBC driver of class '' for connect URL 'null' and i too got the same error. ijust need to get a solution for this so thats why i am writing in detail what i am doing
i logged in tomcat manager and create a datasource here are teh parameters
JNDI Name-jdbc/myoracle
DataSource URL-jdbc racle:thin:@172.16.1.123:1521:nmes
JDBC Driver Class- oracle.jdbc.driver.OracleDriver (i put ojdbc.jar file in the tomcat common\lib folder, BTW i also put classes12.jar file since i was also trying to use some other driver but still error.)
user name : XXX
password : XXX

Here is my code which is use to get hte context
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("Boom - No Context");
DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/myoracle");
if (ds != null) {
Connection conn = ds.getConnection();

The error occurs when i call ds.getConnection() and throws up the following message. which i dont understand why???
Any help.
i failed to understand where can be the problem
There is one more thing i wanted to ask, since i am using IntelliJ and i define the context in intelliJ for example sturtsEx and it works. i wanted to know how does Tomcat knows about it since i never manually created the context in the server.xml file. The IDE takes care of everthing. Will appreciate if some one can explain me how tomcat does that
Rashid
[ March 07, 2006: Message edited by: Bear Bibeault ]
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!