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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Connecting to a Database » Simple connection examples

Connecting to a database on your own computer from Sybase Central or Interactive SQL Next Page

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 largely hidden from the application's user.

When an application uses an embedded database, the personal server is generally not running when the application connects. In this case, you can start the database using the connection string, and by specifying the database file in the DatabaseFile (DBF) parameter of the connection string.

Using the DBF parameter

The DatabaseFile (DBF) parameter specifies which 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.

The following connection parameters show how to load the sample database as an embedded database:

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

For information about samples-dir, see Samples directory.

Using the ENG parameter

It is recommended that you use the EngineName (ENG) connection parameter when using an embedded database. This ensures that the database will connect to the correct database server in case there are other applications running SQL Anywhere database servers on the same computer.

Using the StartLine [START] parameter

The following connection parameters show how you can 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=dbeng10 -c 8M
DBF=samples-dir\demo.db
UID=DBA
PWD=sql

There are a number of 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:

See also