An understanding of how SQL Anywhere establishes connections can help you resolve connectivity problems. For information about network-specific issues, including connections across firewalls, see Communication protocols.
To establish a connection, SQL Anywhere:
Locates the interface library. See Locating the interface library.
Assembles a list of connection parameters. See Assembling a list of connection parameters.
Locates a database server. If the database server is not found, then SQL Anywhere starts a personal server. See Locating a database server.
Locates the database. See Locating the database.
The SQL Anywhere connection procedure is the same for:
Any ODBC application using the SQLDriverConnect function, which is the common connection method for ODBC applications. Many application development systems, such as Sybase PowerBuilder, belong to this class of application. The SQLConnect function is also available to ODBC applications.
Any client application using embedded SQL and using the recommended function for connecting to a database (db_string_connect). In addition, the CONNECT SQL statement is available for embedded SQL applications and in Interactive SQL. It has two forms: CONNECT AS and CONNECT USING. All the database utilities, including dbisqlc, use db_string_connect.
Any .NET application using ADO.NET. The application creates a new SAConnection object and passes the connection string to the constructor or sets the ConnectionString property. Then the application calls the Open method on the SAConnection object to connect.
Any ADO application using the ADODB Connection object. The Provider property is used to locate the OLE DB driver. The ConnectionString property may use DataSource as an alternative to DataSourceName and User ID as an alternative to UserID.
Any application using the SQL Anywhere JDBC driver to pass the URL jdbc:sqlanywhere: followed by a standard connection string as a parameter to the Driver Manager.GetConnection method.
Locating the interface library
Assembling a list of connection parameters
Locating a database server
Locating a database server using the Broadcast Repeater utility
Locating SQL Anywhere database servers using the Host connection parameter
Locating SQL Anywhere database servers using the CommLinks=TCPIP connection parameter
Locating the database
Caching database server address information in sasrv.ini for faster connections
Testing that a database server can be found (dbping)
Testing embedded SQL and network connection performance (dbping)
Ensure that you are using compatible protocols
A checklist of common problems
Discuss this page in DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|