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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Database Administration » Starting and Connecting to Your Database » SQL Anywhere database connections » Sample SQL Anywhere database connections

 

Connecting to an embedded database

An embedded database, designed for use by a single application, runs on the same computer as the application and is generally hidden from the user.

When an application uses an embedded database, the personal server is generally not running when the application connects. The database is started using the connection string, and by specifying the database file in the DatabaseFile (DBF) parameter of the connection string.

To improve query performance for autostarted databases, start the database as soon as possible, even if users are not connecting right away. This allows the cache to warm before queries are executed against the database. See Using cache warming.

Using the DBF connection parameter

The DBF connection parameter specifies the database file to use. The database file automatically loads onto the default server, or starts a server if none are running.

The database unloads when there are no more connections to the database (generally when the application that started the connection disconnects). If the connection started the server, the database server stops once the database unloads.

In the following example, the sample database is loaded as an embedded database:

DBF=samples-dir\demo.db
UID=DBA
PWD=sql

For information about samples-dir, see Samples directory.

Using the ENG connection parameter

When using an embedded database it is recommended that you use the ServerName (ENG) connection parameter. This ensures that the database connects to the correct database server if there are other applications running SQL Anywhere database servers on the same computer.

Using the StartLine [START] connection parameter

The following connection parameters show you how to customize the startup of the sample database as an embedded database. This is useful if you want to use options, such as the cache size:

START=dbeng11 -c 8M
DBF=samples-dir\demo.db
UID=DBA
PWD=sql

There are many connection parameters that affect how a server is started. It is recommended that you use the following connection parameters instead of providing the corresponding server options within the StartLine (START) connection parameter:

Using the ELEVATE connection parameter

If you are autostarting a database server on Windows Vista, you must specify ELEVATE=YES in your connection string so that autostarted database server executables are elevated. On Windows Vista, only elevated database servers can use AWE memory or call procedures as an administrator user.

See also