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

    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: java.net.ConnectException: Connection refused: connect
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(Erro rMessage.java:487)
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheck Dead(ErrorMessage.java:723)
    at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3071)
    at com.sybase.jdbc2.tds.Tds.login(Tds.java:394)
    at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybCo nnection.java:218)
    at com.sybase.jdbc2.jdbc.SybConnection.regularConnect (SybConnection.java:195)
    at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConn ection.java:174)
    at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConn ection.java:126)
    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: "127.0.0.1 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: "127.0.0.1 localhost" and "192.168.0.30 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 127.0.0.1. Is there a limitation on the Developer Edition that only works with 127.0.0.1 and not any other ip? If not, what is the problem? Thanks.
    Last edited by wanderer; 06-06-03 at 16:06.

  2. #2
    Join Date
    Jun 2002
    Location
    Argentina
    Posts
    78

    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
    ok
    Session 1 InterfacesDriver>>

    Server objects found:
    syblinux
    syblinux_back
    syblinux_mon

    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

    127.0.0.1 localhost.localdomain localhost
    70.101.83.200 xxx

    But the xxx must diferent from localhost !!!!


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

    Good luck


    Sebastian

Posting Permissions

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