• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database Connection problem.Help Please

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Can anyone show an Light for me , why am i getting the Following Error while trying to connect to the Oracle Database via Oracle Driver.
Error : Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

My class:

public class InfoCtrDbConnector
{
Connection connection=null;
private Stringdbname="";
private Stringusername="";
private Stringpassword="";
/***************************************************************************
* Contructor for the Class.Database URL , Database name and password
* are retrived from the Property file using Property Manager class.
*
* @param NonParamterezed constructor
**************************************************************************/

public InfoCtrDbConnector() throws Exception
{
this.dbname = "10.200.77.96:1521:WFLOWD1";this.username = "xxxx"; this.password = "xxxx"; }
/***************************************************************************
* getConnection function returns the connection object.Connection object is
* retrived using the Driver Managers getConnection method by passing the
* DB URL,DB name and DB Password.
*
* @param Empty Paramter
* @return Connection-Returns the Connection object.
**************************************************************************/
public Connection getConnection() throws Exception
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
this.connection=DriverManager.getConnection("jdbc racle:thin:@"+dbname,
username,
password);
return this.connection;
}

/***************************************************************************
* closeConnection function is used to close the Currenet Datbase Connection
* Object.
*
* @param Connection Object Paramter
* @return Returns the Connection object.
**************************************************************************/
public void closeConnection(Connection connection) throws Exception
{
connection.close();
}
}
regards
Ramesh
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(dbURL,username,password);
these two lines works for me
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic