0

I just have a trouble connecting my oracle database installed on JVM to JAVA(Eclipse) using JDBC API.

Following is the code on JAVA that I used to establish connection but it fails to connect giving error message

java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@(description=(address=(host=127.0.0.1)(protocol=tcp)(port=1521))(connect_data=(sid=orcl1)))",
"system", "oracle");

For your reference, my network on JVM is configured to Bridged Adaptor which uses Wi-Fi. IP address for JVM(Linux OS) is 192.168.0.199 which is totally different from localhost IP. It changes depending on your Wi-Fi.

Help here is really appreciated.

Thank You.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Connor
  • 21
  • 3
  • `sqlplus` is an SQL client, the DBMS / database is Oracle Database. Likewise, calling Oracle VirtualBox a JVM is very misleading (since a JVM is any process running java code), you should simply call it a VM. – Aaron Aug 30 '17 at 13:39
  • Look up [port forwarding](https://stackoverflow.com/a/10076989/1678362) if you haven't. – Aaron Aug 30 '17 at 13:44
  • @Aaron Thank you Aaron! your link helped me to resolve the issue. I just had to configure port forwarding like you mentioned :) – Connor Aug 30 '17 at 16:06

0 Answers0