![]() | ![]() |
Home |
|
|
ASA User's Guide |
|
| Part 1 Working with Databases |
|
| Chapter 2: Connecting to a Database |
|
| Connection parameters |
The following table lists the Adaptive Server Anywhere connection parameters.
For a full description of each of these connection parameters, see Connection and Communication Parameters . For character set issues in connection strings, see Connection strings and character sets .
Parameter | Short form | Argument |
Agent | Agent | String (Any or Server) |
AutoStart | AStart | Boolean |
Autostop | AStop | Boolean |
CommBufferSize | CBSize | Integer |
CommBufferSpace | CBSpace | Integer |
CommLinks | Links | String |
ConnectionName * | CON | String |
DatabaseFile | DBF | String |
DatabaseName | DBN | String |
DatabaseSwitches | DBS | String |
DataSourceName | DSN | String |
Debug | DBG | Boolean |
DisableMultiRowFetch | DMRF | Boolean |
EncryptedPassword | ENP | Encrypted string |
Encryption | ENC | Boolean |
EngineName / ServerName | ENG | String |
FileDataSourceName | FileDSN | String |
Integrated | INT | Boolean |
LivenessTimeout | LTO | Integer |
Logfile | LOG | String |
Password ** | PWD | String |
StartLine | Start | String |
Unconditional | UNC | Boolean |
Userid ** | UID | String |
* Not used by ODBC connections
** Verbose form of keyword not used by ODBC connection parameters
Boolean values
Boolean (true or false) arguments are either YES, ON, 1, or TRUE if true, or NO, OFF, 0, or FALSE if false.
Case sensitivity
Connection parameters are case insensitive.
The connection parameters used by the interface library can be obtained from the following places (in order of precedence):
Connection string
You can pass parameters explicitly in the connection string.
SQLCONNECT environment variable
The SQLCONNECT environment variable can store connection parameters.
Data sources
ODBC data sources can store parameters.
Compatibility data source
A special data source is available for compatibility with SQL Anywhere Version 5 client/server connections.
Character set restrictions
The server name must be composed of the ASCII character set in the range 1 to 127. There is no such limitation on other parameters.
For more information on the character set issues, see Connection strings and character sets .
Priority
The following rules govern the priority of parameters:
The entries in a connect string are read left to right. If the same parameter is specified more than once, the last one in the string applies.
If a string contains a data source or file data source entry, the profile is read from the configuration file, and the entries from the file are used if they are not already set. For example, if a connection string contains a data source name and sets some of the parameters contained in the data source explicitly, then in case of conflict the explicit parameters are used.
Connection parameters often provide more than one way of accomplishing a given task. This is particularly the case with embedded databases, where the connection string starts a database server. For example, if your connection starts a database, you can specify the database name using the DBN connection parameter or using the DBS parameter.
Here are some recommendations and notes for situations where connection parameters conflict:
Specify database files using DBF
You can specify a database file on the Start parameter or using the DBF parameter (recommended).
Specify database names using DBN
You can specify a database name on the Start parameter, the DBS parameter, or using the DBN parameter (recommended).
Use the Start parameter to specify cache size
Even though you use the DBF connection parameter to specify a database file, you may still want to tune the way in which it starts. You can use the Start parameter to do this.
For example, if you are using the Java features of Adaptive Server Anywhere, you should provide additional cache memory on the Start parameter. The following sample set of embedded database connection parameters describes a connection that may use Java features:
DBF=path\asademo.db DBN=Sample ENG=Sample Server UID=dba PWD=sql Start=dbeng6 -c 8M
|
|