Solved

JDBC connection problem ...

Posted on 1998-08-26
4
220 Views
Last Modified: 2010-03-30
I am trying to connect to an oracle database using the function
DriverManager.getConnection ("jdbc:oracle:thin:@(description=(address=(host=hostname)(protocol=tcp)(port=1521))(connect_data=(sid=oraclesid)))", "user", "pass");

I get an error saying connection refused!!

Any suggestions on why this might happen ...

Thanks
0
Comment
Question by:aswinmajj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:Sieger
ID: 1222632
Have you try port 1526 as well?
0
 
LVL 8

Expert Comment

by:diakov
ID: 1222633
I believe it will be usefull to ask the system administrator to look into the error logs files of the oracle server machine. There might be an indication of the problem the way Oracle sees it.
0
 

Accepted Solution

by:
santhu083198 earned 50 total points
ID: 1222634
The most probable reason is the port no is wrong.
1. make sure there is an sid,in your case, oraclesid.
2. open the tnsnames.ora file. There will be details about all sids here.
3.Find the record for your sid.
4.You can see the host, protocol, port info in this record.

use these values in your connect statement.

Hope this will help

0
 

Expert Comment

by:keoktay
ID: 1222635
Hi,

Could it be one of the following :
1) Your database server is behind a firewall ?
2) You are trying to make a connection using an applet instead of a application ?
3) You have not register your oracle driver using
     Class.forName ("oracle.jdbc.driver.OracleDriver");  ?
4) You are using Personal Oracle ?

Regards,
Keok Tay
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question