| Author |
Database Connection problem.Help Please
|
Ramesh Lakshmanan
Greenhorn
Joined: Oct 14, 2002
Posts: 21
|
|
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
|
SCJP1.2,SCWCD<br />SAP/J2EE Consultant<p><br />"Plan for the Work and Work for the Plan."
|
 |
amanda wu
Greenhorn
Joined: Mar 16, 2003
Posts: 25
|
|
Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection(dbURL,username,password); these two lines works for me
|
 |
 |
|
|
subject: Database Connection problem.Help Please
|
|
|