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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere JDBC driver » Using the iAnywhere JDBC driver


Supplying a URL to the driver

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

Connection con = DriverManager.getConnection(
      "jdbc:ianywhere:DSN=SQL Anywhere 11 Demo" );

The URL contains jdbc:ianywhere: followed by a standard ODBC connection string. The connection string is commonly an ODBC data source, but you can also use explicit individual connection parameters, separated by semicolons, in addition to or instead of the data source. For more information about the parameters that you can use in a connection string, see Connection parameters.

If you do not use a data source, you should specify the ODBC driver to use by including the DRIVER parameter in your connection string:

Connection con = DriverManager.getConnection(
      "jdbc:ianywhere:driver=SQL Anywhere 11;..." );