Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere Server - Programming » JDBC support » The jConnect JDBC driver


Supplying a URL to the driver

To connect to a database via jConnect, you need to supply a URL for the database. For example:

Connection con = DriverManager.getConnection(
      "jdbc:sybase:Tds:localhost:2638", "DBA", "sql");

The URL is composed in the following way:


The individual components are:

  • jdbc:sybase:Tds   The jConnect JDBC driver, using the TDS application protocol.

  • host   The IP address or name of the computer on which the server is running. If you are establishing a same-host connection, you can use localhost, which means the computer system you are logged into.

  • port   The port number on which the database server listens. The port number assigned to SQL Anywhere is 2638. Use that number unless there are specific reasons not to do so.

The connection string must be less than 253 characters in length.

If you are using the SQL Anywhere personal server, make sure to include the TCP/IP support option when starting the server.

Specifying a database on a server
Database options set for jConnect connections