Contents Index Connecting to multiple databases Including SQL statements in UltraLite Java applications

UltraLite Static Java User's Guide
  Data Access Using Pure Java
    Connecting to and configuring your UltraLite database

Configuring the UltraLite Java database


You can configure the following aspects of the UltraLite Java database:

These aspects can be configured by supplying special values in the database URL, or by supplying a Properties object when creating the database. The encryption key cannot be set on the URL, but must be set in a Properties object.

For more information, see Using the UltraLite JdbcDatabase.connect method, and Using a Properties object to store connection information.

Transient and persistent databases 

By default, UltraLite Java databases are transient: they are initialized when the database object is instantiated, and vanish when the application closes down. The next time the application starts, it must reinitialize a database.

You can make UltraLite Java databases persistent by storing them in a file. You do this by specifying the persist and persistfile elements of the JDBC URL, or by supplying persist and persistfile Properties to the database connect method.

Initializing transient databases 

The database for C/C++ UltraLite applications is initialized on the first synchronization call. For UltraLite Java applications that use a transient database, there is an alternative method of initializing the database. The URL for an UltraLite database that is used as the initial database is supplied in the persistfile component to the URL.

Configuring the database 

The database configuration components of the URL are as follows:

jdbc:ultralite:transient:none:http://www.address.com/transient.udb

You can prepare the initializing database with an application that uses the persistent form of the URL to create the database, synchronize, and exit.


Contents Index Connecting to multiple databases Including SQL statements in UltraLite Java applications