Where SID value is what I obtained from select instance_name from v$instance;
and Database_IP is the IP address of the server hosting Oracle.

However I get the exception:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ReadOracle.main(ReadOracle.java:8)

are you able to ping server IP
open command prompt and try to run c:/ping Database_IP

srinivas srinivasmeenavalli
Ranch Hand

Joined: Jul 13, 2008
Posts: 65

posted Nov 06, 2009 08:32:38

0

I have one more question . What kind of program it is ?
is it being called from a applet or stand alone ?

pratike shahh
Greenhorn

Joined: Nov 06, 2009
Posts: 5

posted Nov 06, 2009 08:45:09

0

This is a test program which I am trying to run from my local machine.
Eventually this will be a middleware program for one of our interfaces.

pratike shahh
Greenhorn

Joined: Nov 06, 2009
Posts: 5

posted Nov 06, 2009 08:56:14

0

okay this is what I tried and it seems to work:
1. Created s DSN entry on my machine
2. And then used:
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
Connection con=DriverManager.getConnection(“jdbcdbcSN name”,”usr”,”pwd”);

And this seems to work, I tried a test query and it seems to work..

Is this is also a right way to do so..
Eventually this program will run on one of our servers as an Interfac/middleware program..