network adapter error while connection (help urgent)
felix thomas
Ranch Hand
Joined: Jun 10, 2001
Posts: 89
posted
0
hi, i am getting the error whille runing the below code Exception in thread "main" java.sql.SQLException: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.check_error(DBError.java) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja va) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at dbAccess.main(dbAccess.java:7) import java.sql.*; class dbAccess { public static void main (String args []) throws SQLException { DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc racle:thin:@felix:2481 rcl", "scott", "tiger"); // @machineName ort:SID, userid, password Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION"); while (rset.next()) System.out.println (rset.getString(1)); // Print col 1 stmt.close(); } }
my operating system is windows98 amd oracle 8.1.5 how can i know the SID of a oracle database.have not used the correct SID of the database. it is loading the driver only while connection does it says this error i think Please help