ASA Database Administration Guide
Any client application that uses a database must establish a connection to that database before any work can be done. The connection forms a channel through which all activity from the client application takes place. For example, your user ID determines permissions to carry out actions on the database—and the database server has your user ID because it is part of the request to establish a connection.
When a user connects to a database, the database server assigns the connection a unique connection ID. For each new connection to the database server, the server increments the connection ID value by 1. These connection IDs are logged in the -z server output and the client LOGFILE connection parameter output. The connection ID can be used to filter request logging information, identify which connection has a lock on the database, or track the total number of connections to a server since it started and the order in which those connections were made.
For information about request logging, see Request logging.
For information about locks, see How locking works.
To establish a connection, the client application calls functions in one of the Adaptive Server Anywhere interfaces. Adaptive Server Anywhere provides the following interfaces:
ODBC ODBC connections are discussed in this chapter.
ADO.NET ADO.NET connections are discussed in this chapter.
For more information about ADO.NET connections, see The ADO.NET programming interface.
Sybase Open Client Open Client connections are not discussed in this chapter.
For information on connecting from Open Client applications, see Adaptive Server Anywhere as an Open Server.
jConnect JDBC driver Sybase Central and Interactive SQL have the connection logic described in this chapter built into them. Other applications using jCOnnect cannot use the connection logic discussed in this chapter.
For more information on connecting via JDBC, see JDBC Programming.
The interface uses connection information included in the call from the client application, perhaps together with information held in a data source, the SQLCONNECT environment variable, or the server address cache, to locate and connect to a server running the required database. The following figure is a simplified representation of the pieces involved.
The following table identifies where you can find answers to questions.
| If you want... | Consider reading... |
|---|---|
| An overview of connecting from Sybase Central or Interactive SQL (including a description of the drivers involved) | Connecting from Sybase Central or Interactive SQL |
| Some examples to get started quickly, including Sybase Central and Interactive SQL scenarios | Simple connection examples |
| To learn about data sources | Working with ODBC data sources |
| To learn what connection parameters are available | Connection parameters |
| To see an in-depth description of how connections are established | Troubleshooting connections |
| To learn about network-specific connection issues | Client/Server Communications |
| To learn about character set issues affecting connections | Connection strings and character sets |
How connection parameters work
Connection parameters passed as connection strings
Saving connection parameters in ODBC data sources
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.