• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

URGENT HELP NEEDED

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I DON'T KNOW HOW TO CONFIGURE TOMCAT TO WORK WITH JDBC.
My web application used servlet,jsp with Tomcat. I need to do a lot of database calls.
My tomcat is not recognising my environment.
What all do I need to do for having tomcat call the database ?
Please help me == urgent
Maya
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maya,
Just a thought...
Hope u have the CLASSPATH set so that it inclues the correct JDBC classes for the database.
eg
--------------------------------------------
CLASSPATH=d:\oracle\jdbc\lib\classes12.zip
------------------------------------------
for the oracle database.
So depending on what database u are using including the correct classpath may solve the problem.
Once again this is just a thought.
Try and give a little more desc on the problem...
Regards
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Abraham,
Thanks for the response.
My problem is this,
In my machine I do have Oracle installed in my c: drive and the CLASSPATH is set correctly.
Now for my servlet to work, the servlet engine tomcat is in opur server and I have a drive mapped to the server where I create my files. The drive is I:
Now , my servlet needs to use JDBC. It has a statement for getting the connection to the database in my machine.
So as per a doc, I added classes.zip, the zip file with the Oracle driver in the /lib directory of Tomcat.
I added even that directory in my classpath,...
Now I am testing with a URL thru our server which runs tomcat. But I am not getting the connection, or the driver is not getting recognised...
Any help
Maya
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check the JDBC configuration info in the server.xml file of Tomcat?
Beksy
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A stack trace of the error would be really beneficial.

You say: "But I am not getting the connection, or the driver is not getting recognised..."

Well, which one? They are different errors with (probably) different causes. Driver not being loaded is usually a classpath thing. Connection is usually a bad JDBC URL.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It could also because of a version mismatch.
Did you check the compatibility of your driver against JDK/JDBC version ?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi maya,
Can u help me how u have linked servlet pages to jsp.
I am using res.sendRedirect(urlString) but it din't work to link servlet to jsp.Is there any other way to link the same.
My servlet & jsp pages are stored in different directory.I am using weblogic server.
Thanks.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic