• 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

Problem with localhost

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all!! I'm working in a Java-Hibernate web project, but I am having a problem with my database connection. When I try to connect to it by writing localhost instead of my IP address, I can't connect to my db. The following error appears: java.sql.SQLException: I/O Exception: The Network Adapter could not establish the connection. Also, when I try to connect using the command telnet localhost 1521 the following error appears: Could not open connection to the host, on port 1521: Connection failed.
Why is this problem happening? How can I solve it?

I'm using Oracle 11g, any suggestion will be really appreaciated!
Thanks in advance
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rose. That is not a problem with your code, but with the configuration of your computer.

If you are on windows, you can check in your computer has a localhost entry in its host file.
(on my xp installation, the host file is located at C:\WINDOWS\system32\drivers\etc)

The entry should look like this:

If the entry is there, or if adding the entry does not resolve your problem, you can contact your support team to help resolve it.


Executing
> tracert localhost (traceroute on linux and unix)
and
> ping localhost
will give your support team useful info.

Regards, Jan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic