• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Io exception: The Network Adapter could not establish the connection on Oracle 10g RACK

 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am getting the starge exception while connecting to DB using eclipse indigo.

I tried to connect to DB I am getting . If I keep on trying after few time it connects.
I am connecting the same DB with other clients like ToAD, SQL Plus etc are working fine.

Details are :
Database : Oracle 10g RACK installation on Linux 2.4 machine
Client : elipse indigo (some JDBCE program) on windows XP

Usual reasones for this exception are
A. TNS Lister instance is down in the DB server
B. privileges are not granted for your credentials
C. given port is not visible/available
but none of the above are the reasons as some times conectivity is working fine and some times getting the exception

It looks strange behavior for me.
1. From few machines it works fine always
2. From few machines some times I get exception and somtimes it works fine

I dont know what to check.

Thanks in advance,
Appreciate the help.
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be really helpful to me if someone gives light on this.
Please help me.
 
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Contact your network adminstrator and/or database administrator. The connection between your code and the database server could not be made, and the fault probably does not lie in your code (unless you have a wrong connection URL).
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I have contacted network admin but he said there will be some issue in client which I am using.
But I am using eclipse Indiigo. I don't know what is the issue with it
 
Rob Spoor
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us the code you're using for connecting?
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

In fact I am using tomcat Data Source to connect to DB.
I am using class to get the connection from Data source.

I have added the Database entires in context.xml in tomcat as follows


my java Connection logic is


Please help me, I am facing this issue from 2 to 3 months.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have to use that TNSNAMES style connection info in your jdbc url? It seems to include a lot of connect options which may actually be causing problems, if you aren't sure you actually need them. I mean this: "(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DBServiceName)(FAILOVER_MODE = (TYPE=session) (METHOD=basic)(RETRIES = 180) (DELAY =5)))"

What if you just used a standard jdbc url like jdbc:oracle:thin:@someHostname:myport:DBServiceName

Other than that, to debug this issue you need your database administrator to help trace the connection. When you get your "The Network Adapter could not establish the connection" error, the server should have a bit more information in the logs on the server side. It may help.
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much John, you have given very good info.

I have contacted Admin but he says my client may have problem.
My client info:
Eclipse Java EE IDE for Web Developers.
Version: Indigo Release
Build id: 20110615-0604

We are using correct options only for the connection string.

I do not understand why this exception comes some times and some times wokrs fine.

any help really appricated.

Regards
Amruth
 
john ho
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well it looks like you only have problems with JDBC, since toad and sqlplus use native drivers to connect. i am actually not sure which jdbc driver eclipse uses, but i'm sure it's one of the thin ones.

if you really want to get to the bottom of this, check which driver eclipse uses, then write a small java program that uses that same driver to make a connection to the database with the same connection parameters. Run it many times until you get the error. But you will need cooperation from the DBA to trace the sessions to see really what the problem is.

but i guess since you only have the problem in your dev environment maybe the DBA doesn't want to make the effort in debugging an intermittent glitch ... after all it's not a showstopper, just an annoyance isn't it?

one other thing to try ... do you use SQL Developer from oracle (java based-graphical equivalent of sqlplus)? it also uses jdbc to connect to the database ... see if that has the problem as well.
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic