Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2004, 03:09 PM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Exception connecting to Oracle Database with JDBC

Hello,
I am quite new to JDBC and Oracle so please be patient with me.
I am trying to connect to an Oracle Database but I get an Exception: COnnection Refused
Here is what I am doing:
  ....
try
{
String JdbcDriver= "oracle.jdbc.driver.OracleDriver";
Class.forName(JdbcDriver).newInstance();
}
catch(Exception ex)
{
System.out.println("Can't find the driver");
}
try
{
System.out.println("Trying to connect...");
String JdbcURL=""jdbc:oracle:thin:aaa/[email protected]:1521:siu";
conn=DriverManager.getConnection(JdbcURL);
connected=true;
}
catch (Exception e)
{
connected=false;
exceptionMessage="SQL exception: "+e.getMessage();
System.out.println("essage="+e.getMessage());
}

When executing the getConnection method, I get the following exception:
Connection refused(DESCRIPTION=(TMP=)(V
SNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CO DE=12505)(EMFI=4))))

Anyone can help me or at least give me a hint about where to look?

Thank you in advance.

 
Old March 31st, 2004, 04:42 AM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved. The database instance was incorrect. It was not siu but nr!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception while loading JDBC driver dshashi1234 Java Databases 0 December 21st, 2006 02:34 AM
Connecting to oracle database in struts Manvi Struts 3 August 7th, 2006 10:53 PM
Connecting Oracle Database with an ASP page krisvamshi Oracle ASP 3 November 14th, 2004 05:56 PM
Creating and connecting in a Oracle Database cutovoi Excel VBA 2 February 4th, 2004 07:06 PM
Connecting an oracle database kelitu Oracle 0 September 4th, 2003 09:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.