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.