• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with localhost

 
Rose Rimsky
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic