oracle jdbc thin driver

I'm using oracle jdbc thin driver to connect to database,
"url" : "",
 it worked on inside server.
But on outside server, it gives the following error:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

I've opened up server port: 1521 sqlnet to outside server IP. Not sure what's the problem. THanks.
Who is Participating?
CEHJConnect With a Mentor Commented:
telnet 1521

Open in new window

If that don't work, then the driver won't either. Only you can find out why ...
johnsoneSenior Oracle DBACommented:
If the server is behind a firewall, opening up port 1521 doesn't get you what you need.  The listener listens on that port, but the actual connection is passed off to an open high numbered port.

The best way to avoid this that I know of is by using Connection Manager.  It can run on the database server on port 1521 and then pass off the connection to the database listener on any port.  Then all traffic goes through 1521.

The documentation for Connection Manager is here:
is there a firewall between your PC and the remote host /the outside server/ ?
is there a difference of the versions of oracle running on inside and outside servers?
1. check if database server host name exists in the etc/hosts file
2. change the jdbc driver class from oracle.jdbc.driver.OracleDriver to oracle.jdbc.OracleDriver
xiaoyunwuAuthor Commented:
Actually opening 1521 is good enough. I solved the problem by using IP address ( instead of name (
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.