Solved

JDBC connection problem ...

Posted on 1998-08-26
4
174 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
4 Comments
 
LVL 1

Expert Comment

by:Sieger
Comment Utility
Have you try port 1526 as well?
0
 
LVL 8

Expert Comment

by:diakov
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now