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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere JDBC API » Using the iAnywhere JDBC driver

Loading the iAnywhere JDBC driver Next Page

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 10 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 on 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 10;..." );