Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JDBC connection problem ...

Posted on 1998-08-26
4
Medium Priority
?
228 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
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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

926 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