Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doing JDBC with servlets

 
Lucky Chawla
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey I am having some problems in connecting my servlet with oracle9i as the database and thru the contatiner Tomcat, If i do the same the thing with servlet runner ewverything iget aces to data base,
I have pasted the classes12.jar also but , I always get the message sayin" Ubale to load drivers,

Can anybody help me, Please ???
Thanks
Lucky
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you making database connection? By jndi datasource lookup or by DriverManager?

Post the code snippet which is actually making a connection with the databse.

If you are using Class.forName("oracle.jdbc.OracleDriver"), then you will get ClassNotFoundException. Check it first by printStackTrace()

Naseem
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucky Chawla,
Welcome to JavaRanch!

We're pleased to have you here with us in the JSP forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
 
Lucky Chawla
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am making use DriverManager , I am unable to connect to my database.
But I tried doing this thing with JSP , and you know It works
Anyway I will post the code which i am using for database connection
Can anybody tell me the steps to connect to connect to acces as databse. If possible explain this a few line of coding
Thakns
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lucky Chawla:
I have pasted the classes12.jar also but , I always get the message sayin" Ubale to load drivers,


Pasted where?
 
Lucky Chawla
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have copied the classes12.jar in lib folder of tomcat under common directory
Thanks
Lucky
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should go under common/lib.
This is where it needs to be if you're using container managed pooling.

Since you're using the driver manager, you could also put it under WEB-INF/lib within your own application.
[ August 14, 2006: Message edited by: Ben Souther ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic