title: JZ006: Caught IOException: java.net.ConnectException: Connection refused?
body: <p>When I use following code to connect sybase ASE 16,I get an error: </p>
  
  <blockquote>
    <p>JZ006: Caught IOException: java.net.ConnectException: Connection
    refused</p>
  </blockquote>
  
  <p>The code is :</p>
  
  <pre><code>package sybase;
  
  import java.sql.*; 
  import java.util.*;
  public class Conn2ASE {
  public static void main(String[] args) {
      try {
          Class.forName("com.sybase.jdbc3.jdbc.SybDriver").newInstance();
          String url = "jdbc:sybase:Tds:192.168.100.120:5000/master";
          Properties sysProps = System.getProperties();
          sysProps.put("user", "sa");
          sysProps.put("password", "560128");
          Connection conn = DriverManager.getConnection(url, sysProps);
          Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
          String sql = "select id,name,crdate from dbo.sysobjects where type='U'";
          ResultSet rs = stmt.executeQuery(sql);
          while (rs.next()) {
              System.out.println("oject_id:"+rs.getString(1)+",oject_name:"+rs.getString(2)); 
          }
          rs.close();
          stmt.close();
          conn.close();
      } catch (Exception e) {
          System.out.println(e.getMessage());
      }
      }
  }
  </code></pre>
  
  <p>What's the problem? Can anyone tell me?</p>