Skip to Content
0

JZ006 Connection Refused

May 10 at 07:22 AM

91

avatar image
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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Chris Keating
May 10 at 10:28 AM
0

jConnect depends on TCP/IP for connectivity. You need to ensure that the SQL Anywhere database server that you attempting to connect is configured to listen on TCP/IP. If you are running a standalone engine (i.e., dbeng17), you will need to add -x tcpip to thje engine startup..

Share
10 |10000 characters needed characters left characters exceeded