Setting Up the Connection Profile

The Connection Profile stores information detailing where and how the local database is stored, including location and page size. The connection profile also contains UltraLite®J runtime tuning values.

Set up the connection profile before the first database access, and check if the database exists by calling the databaseExists method in the generated package database class. Any settings you establish after the connection has already been established will not go into effect.

The generated database class automatically contains all the default settings for the connection profile. You may add other settings if necessary. For example, you can set the database to be stored in an SD card or set the encryption key of the database.

Use the SUPConnectionProfile class to set up the locally generated database. Retrieve the connection profile object using the Sybase Unwired Platform database's getConnectionProfile method.

SUPConnectionProfile* cp = [SUP101SUP101DB getConnectionProfile];
[cp setEncryptionKey:@"Your key"];

An application can have multiple threads writing to the database during synchronization by enabling the connection profile property, allowConcurrentWrite. Setting the property to "true" allows multiple threads to perform create, read, update, or delete operations at the same time in a package database.

Note: Although multiple threads are allowed to write to the database at the same time, however, there will be errors when multiple threads write to the same MBO. Develop your application in such a way to avoid this situation.
Related reference
SUPConnectionProfile