• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange problem in Tom CAT + oracle +JDBC connection

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I need to invoke a simple servlet which has JDBC
connection with oracle9i. I am able to create connetion with
Web Logic successfully But now I am trying to make it with jakarta tom cat 5.0.16 which giving me problem

Problem Statement :

First Part
***********

When Oracle service is stopped on my machine,

I am able to invoke servlet from browser and it is showing Debugging statement and showing this error ------>

Exception was thrown: ORA-06401: NETCMN: invalid driver designator
-----------------------------------------------------------------------

Second Part
**********

When oracle service is running on my machine

no response from Tom cat console and even No connetion <br>
between BROWSER AND TOM CAT ie. browser is not invoking servlet by hitting url .

My code for JDBC connection is
-------------------------------


<<<
System.out.println("Establishing driver");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc racle ci:@HostName:1521 rcl","scott","tiger");
System.out.println("connetion established ");

Essence is
*************

So not getting response from tom cat when oracle service is running is one problem and Not sure about connection string is second problem ....

pls help me regarding this

thanks a lot in advance
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Pallav,

pelase provide following information

1. Are you getting any System.out.println on console
2. put your code in try catch block if it is not in try-catch
3. if you are getting any exception what is it
4. verify your classpath if oracle.jdbc.driver.OracleDriver is in your classpath

hope after verifying these steps your problem will solve.
 
Pallav sharma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shailesh,
I started Tom cat server and oracle services was running, then I hit the url,first it promp user/password dialogue box above then written XDB , so I have given scott / tiger, then it says PAGE NOT FOUND
ERROR 404 ..
now I am getting error whether tom cat is running or not
and is it problem related with tom cat realms??
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By assuming that you are gettin this 404 error from you r tamcat server, i think that your tomcat is running fine.
 
Shailesh Chandra
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pallav sharma:


Not sure about connection string is second problem ....




Pallav,
Even I thing your tomcat is running fine.
try to run examples of tomcat to verify that tomcat has no problem

and you didn't tell if you are gettting any System.out.println in console.

even if your problem is with connection , you should get "Establishing driver" printed in console.

and try to make thin connection by using string

DriverManager.getConnection("jdbc racle:thin:@HostName:1521 rcl,"scott","tiger");

is there any stackTrace in your console.
 
Pallav sharma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shailesh,

About Tom Cat
*************
Tom cat is fine since I am getting test messages in Tom cat console WHEN oracle service is not running on those run Listner is not there Exceptions are coming which is obvious.

what is happening
*****************

Again I am telling you what is happening here please do give attention

1 start Tom cat
2 oracle service is running
3 given path in url to invoke servlet
4 user password box pop up and just below the heading bar XDB is written
5 I given the scott/tiger
6 error 404 is came

and NO response in tom cat server console

if oracle service not running
so 4 and 5 step never comes only
in 6 step blank screen will come

and In Tom cat console EXCEPTION : No listner is there
will come ...



sorry for big story but only this is my problem
and No example for JDBC connetion is there in Tom cat example
other example is running fine ..

thanks for your efforts
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what driver are you using for ORACLE.

is it thin driver, or
oci driver.

thin driver requires SID
oci driver requires TNS service name

for TNS service name the listener must be configured. just check it.
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic