Oracle Error 17002 “Io Exception: The Network Adapter could not establish the connection”

If you search for the Oracle error “Io Exception: The Network Adapter could not establish the connection” (ORA-17002) you will find plenty of discussion on the web. It usually comes down to what the message says, that it is a network issue. But the error can also be caused by e.g. incompatible jar files. In my case, however, I was trying to access a 11g R2 instance from SQL Developer and during initial setup everything had worked. And local access, also with SQL Developer, worked absolutely fine.

Solution: Replace “simple” DB hostname with the fully qualified one. I am not sure why this changed the behavior. I can think of either a DNS setup issue (although my search list included the domain) or some kind of reverse lookup logic that is being applied. Anyway, I wanted to share this finding and also record it for my own future use.

30 thoughts on “Oracle Error 17002 “Io Exception: The Network Adapter could not establish the connection”

  1. Thanks for the tip, it worked for me too !!
    Even, I changed localhost to my machine name, it worked, and it was still working when I reverted to localhost. There must be some strange network behaviour beneath.

  2. thank you very much!
    I tried a lot of complex solutions and this was the winner, now I can continue my work, thanks again

  3. other solution :
    you make sure that you have the right DNS on your IP Address this is happened if you have 2 network

    Good luck

  4. Hey, what’s the difference between “simple DB hostname” and “fully qualified DB hostname”? some example pls because I’m not sure did I understand it right? 🙂

  5. Simple name is e.g. “dbserver” whereas fully qualified one is “”. Does that help?

  6. Where can I find fully qualified name? I tried with select * from global_name, but I got same name as simple name….

    thank you

  7. The fully qualified hostname is part of the machine’s network setup and only indirectly part of Oracle

  8. I tried everything, it doesn’t work. Finally i tried by using connection type as local/Bequeath. Then it worked for me.

  9. Other solution: In your application data-source change the connect string from
    “jdbc:oracle:thin:@host:port:sid” (short connection string)


    “jdbc:oracle:thin:@(DESCRIPTION= (ADDRESS = (PROTOCOL = TCP)
    (HOST = host)
    (PORT = port)
    )” (full server string)

  10. Super… Used the fully qualified hostname and it worked. Thanks.

  11. Hello All ,
    I have tried all these techniques but still my facing same issue.
    1- I have data source on my local websphere6.1 and when do test connection from web console server ,it was successful but when i tried to do the same it giving me error
    ” java.sql.SQLException: Io exception: The Network Adapter could not establish the connectionDSRA0010E: SQL State = null, Error Code = 17,002″

    Note : I am connection to remote oracle db.
    in my machine , i have only raid & web sphere installed.

    Please any body help me.

    Advance thank you

  12. It c an be bacause of the wrong credentials of the service name. I changed my system credentials which i was using for the service, the moment i updated that it worked for me. Thanks..!!

  13. I got this error but the hostname is the fully one
    I changed to localhost and it worked fine

  14. i tried this solution but it did not work for me.
    but…after many tests i found out that it was the antivirus’s web protection that was preventing the sockets connection.
    after disactivating web protection service, connection to DB became succesful

  15. Check if you are connected to any vendor VPN. They too block the connection network.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.