Skip to Content
0
May 10, 2018 at 07:22 AM

JZ006 Connection Refused

1595 Views Last edit May 10, 2018 at 07:25 AM 2 rev

Hi Experts.

I am using jconn4 driver to connect to my local SQLA 17 database, however I am always given the error below:

java.sql.SQLException: JZ006: Caught IOException: java.net.ConnectException: Connection refused: connect 
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybConnection.handleSQLE(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybConnection.a(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybConnection.handleHAFailover(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybConnection.<init>(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybConnection.<init>(Unknown Source) 
at com.sybase.jdbc4.jdbc.SybDriver.connect(Unknown Source) 
at java.sql.DriverManager.getConnection(Unknown Source) 
at java.sql.DriverManager.getConnection(Unknown Source) 
at com.pg.ecom.project.mng.common.dao.DaoManager.getConnection(DaoManager.java:145) 
at com.pg.ecom.project.mng.common.dao.DaoManager.<init>(DaoManager.java:96)
at com.pg.ecom.project.mng.common.dao.DaoManager.getInstance(DaoManager.java:82) 
at com.pg.ecom.project.mng.jfc.MosisNG.<init>(MosisNG.java:235) 
at com.pg.ecom.project.mng.jfc.MosisNG.main(MosisNG.java:631)

I am already stuck on this problem for a few hours and kind of desperate to have an answer. I am using the below code to connect to my database:

String dbUri = "jdbc:sybase:Tds:localhost:2638/mosis"
String user= "MOSIAPPS"
String passwd = Decryptor.decrypt(password);  

con = DriverManager.getConnection(dbUri, user, passwd);

Would anyone be kind enough to give me an expert advice on this? I am already down my schedule due to this problem.

Kindest Regards,

Pau