File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Oracle 7 and JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Oracle 7 and JDBC" Watch "Oracle 7 and JDBC" New topic

Oracle 7 and JDBC

Chong YK

Joined: Sep 05, 2001
Posts: 1
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 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="jdbcracle: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(
at oracle.jdbc.driver.OracleConnection.<init>(
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at TestConnect.main(
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!...

Joined: Jul 10, 2001
Posts: 3
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.
I agree. Here's the link:
subject: Oracle 7 and JDBC
It's not a secret anymore!