• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Do you pee on your compost? Does this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic