Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003

    Unanswered: Unable to remotely connect to ASE on a linux machine

    I have a java application running on a PC that uses JConnect 5.5 to connect to an ASE server v12.5 running on a remote RedHat 8.0 linux box. The main calls are:

    Class.forName("com.sybase.jdbc2.jdbc.SybDriver").n ewInstance();
    conn = DriverManager.getConnection("jdbc:sybase:Tds:myhos t:4100/pubs2", "sa", "password");

    But I keep getting the following exception:
    ================================================== =================
    java.sql.SQLException: JZ006: Caught IOException: Connection refused: connect
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(Erro
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheck Dead(
    at com.sybase.jdbc2.tds.Tds.handleIOE(
    at com.sybase.jdbc2.tds.Tds.login(
    at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybCo
    at com.sybase.jdbc2.jdbc.SybConnection.regularConnect (
    at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConn
    at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConn
    at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver. java:179)
    at java.sql.DriverManager.getConnection(DriverManager .java:512)
    at java.sql.DriverManager.getConnection(DriverManager .java:171)
    ================================================== =================

    From the PC, I can ping "myhost". I also tried out some other means to connect:

    Remotely from PC:
    - Java app with JConnect: connection refused
    - Sybase Central Java Edition: cannot connect

    Locally on the Linux box where ASE is hosted:
    - isql: works
    - EXACT same java app with JConnect: works in most of the scenarios described below:

    Scenario 1
    - /etc/hosts has: " myhost localhost"
    - Connection string is: "jdbc:sybase:Tds:localhost:4100/pubs2" --> works
    - Connection string is: "jdbc:sybase:Tds:myhost:4100/pubs2" --> works

    Scenario 2
    - /etc/hosts has: " localhost" and " myhost"
    - Connection string is: "jdbc:sybase:Tds:localhost:4100/pubs2" --> works
    - Connection string is: "jdbc:sybase:Tds:myhost:4100/pubs2" --> NOT work

    Looks like it only works with the host name that is binded to Is there a limitation on the Developer Edition that only works with and not any other ip? If not, what is the problem? Thanks.
    Last edited by wanderer; 06-06-03 at 15:06.

  2. #2
    Join Date
    Jun 2002

    Thumbs up Re: Unable to remotely connect to ASE on a linux machine

    I never work with java but if you can connect from SQLCentral I guess you have trouble with the network configuration.
    First check how is the interfaces, for that you can execute dsedit (xwindows) or dscp (term).
    You must see something like this:

    [sybase@xxx bin]$ dscp

    >> open interfaces
    Session 1 InterfacesDriver>>

    Server objects found:

    Session 1 InterfacesDriver>> read syblinux

    DIT base for object: interfaces
    Distinguish name: syblinux
    Extra attribute: 1
    Extra attribute: syblinux
    Extra attribute: SQL Server
    Extra attribute: 4 (Unknown)
    Extra attribute:
    Transport Type: tcp
    Transport Address: xxx 4100

    Session 1 InterfacesDriver>> exit

    Then you must check that the host "xxx", exists in the /etc/hosts localhost.localdomain localhost xxx

    But the xxx must diferent from localhost !!!!

    Other trouble maybe is the Firewall, try "iptables -L"

    Good luck


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts