Contents Index Connecting using a data source Using default connection parameters

ASA Database Administration Guide
  Connecting to a Database
    Simple connection examples

Connecting to a server on a network


To connect to a database running on a network server somewhere on a local or wide area network, the client software must locate the database server. Adaptive Server Anywhere provides a network library to handle this task.

Network connections occur over a network protocol. Several protocols are supported, including TCP/IP and SPX.

For more information about client/server communications over a network, see Client/Server Communications.

A client connection to a network database server, showing the client using an Interface library to connect to a server running on the network.
Specifying the server 

Adaptive Server Anywhere server names must be unique on a local domain for a given network protocol. The following connection parameters provide a simple example for connecting to a server running elsewhere on a network:

eng=svr_name
dbn=db_name
uid=user_id
pwd=password
CommLinks=all

The client library first looks for a personal server of the given name, and then looks on the network for a server of the given name.

The above example finds any server started using the default port number. However, you can start servers using other port numbers by providing more information in the CommLinks (LINKS) parameter. For information, see CommLinks connection parameter [LINKS].

Specifying the protocol 

If several protocols are available, you can instruct the network library which ones to use to improve performance. The following parameters use only the TCP/IP protocol:

eng=svr_name
dbn=db_name
uid=user_id
pwd=password
CommLinks=tcpip

The network library searches for a server by broadcasting over the network, which can be a time-consuming process. Once the network library locates a server, the client library stores its name and network address in a file (asasrv.ini), and reuses this entry for subsequent connection attempts to that server using the specified protocol. Subsequent connections can be many times faster than a connection achieved by broadcast.

Many other connection parameters are available to assist Adaptive Server Anywhere in locating a server efficiently over a network. For more information see Network communications parameters.

To connect to a database on a network server ( Sybase Central or Interactive SQL )

  1. Start Sybase Central or Interactive SQL and open the Connect dialog (if it does not appear automatically).

  2. On the Identification tab of the dialog, type a user ID and a password.

  3. On the Database tab of the dialog, type the Server Name. You can search for a server by clicking Find.

  4. Identify the database by specifying a Database Name.

Tips 
You can connect using a data source (a stored set of connection parameters) by selecting the appropriate data source option at the bottom of the Identification tab of the Connect dialog.

For information about using data sources in conjunction with the JDBC driver (jConnect), see Specifying a driver for your connection.

By default, all network connections in Sybase Central and Interactive SQL use the TCP/IP network protocol.

See also


Contents Index Connecting using a data source Using default connection parameters