• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Oracle 7 and JDBC

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am trying to connect the java program to Oracle 7.It gives the following error message when i tried to run it on my Win98. I am using jdk1.2.2 and the oracle driver is classes111.zip. My host and sid r based on the sid and port number in the TNSNAMES.ora.My testing code is as below:
import java.sql.*;
public class TestConnect {
public static void main (String[] arg) {
String url="jdbc:oracle:thin:@";
String userId = "scott";
String password ="tiger";
//Load the driver
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
catch (ClassNotFoundException e){
System.out.println("Could not load the driver");

//Request the connection
Connection con = DriverManager.getConnection(url,userId, password );

System.out.println("All okay");
catch (Exception e) { e.printStackTrace();}


Run-time error message:
java.sql.SQLException: Connection refused: no further information
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:230)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:110)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:148)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at TestConnect.main(TestConnect.java:25)
I've checked the message boards but cant find any solution...
I am greatly thankful if any of you out there can give some idea or solutions on the problem!...
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you are trying to connect to an oracle instance running on the local machine ( from where you are trying to connect. Is this oracle instance running?
If you are not running the database on the machine from where you are trying to connect, change the ip to point to the remote machine and try again.
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic