This discussion is archived
7 Replies Latest reply: Nov 1, 2012 1:32 PM by 397277 RSS

Win7: java.sql.SQLException: Io exception: The Network Adapter

934595 Newbie
Currently Being Moderated
Hi,

I have a code snippet to connect to Oracle 11g. Below code works in XP machine (using IBM RAD 7.0 jdk 1.5), but when I use the same code in Win7 machine (IBM RAD 8.0 jdk 1.6). I am getting the exception below. Could someone help me. I am using ojdbc14.jar on both the scenarios.



               String driverName = "oracle.jdbc.driver.OracleDriver";
               Class.forName(driverName);
               String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(FAILOVER=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=dev64-scan)(PORT = 1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dev64-scan)(PORT = 1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dev64-scan)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dev64-scan)(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = dbname)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES=180)(DELAY=1))))";
               connection = DriverManager.getConnection(url,"username","password");


java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
     at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
     at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
     at java.sql.DriverManager.getConnection(DriverManager.java:562)
     at java.sql.DriverManager.getConnection(DriverManager.java:186)

Edited by: 931592 on May 2, 2012 12:44 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points