UltraLite User's Guide
Developing UltraLite Java Applications
Connecting to and configuring your UltraLite database
The URL is a required argument to the DriverManager.getConnection method used to connect to UltraLite databases.
For an overview of connection methods, see Connecting to the database using JDBC.
The syntax for UltraLite JDBC URLs is as follows:
jdbc:ultralite:[database:persist:persistfile][;option=value...]
The components are all case sensitive, and have the following meanings:
jdbc Identifies the driver as a JDBC driver. This is mandatory.
ultralite Identifies the driver as the UltraLite driver. This is mandatory.
database The class name for the database. It is required and must be a fully-qualified name: if the database class is in a package, you must include the package name.
For example, the URL jdbc:ultralite:MyProject
causes a class named MyProject
to be loaded.
As Java classes share their name with the .java file in which they are defined, this component is the same as the output file parameter from the UltraLite generator.
For more information, see The UltraLite generator.
persist Specifies whether or not the database should be persistent. By default, it is transient.
For more information, see Configuring the UltraLite Java database.
persistfile For persistent databases, specifies the filename.
For more information, see Configuring the UltraLite Java database. The UltraLite Java properties are very similar to those for C/C++ applications. Their names differ only in the absence of underscore characters., except that persistfile is analogous to file_name. See UL_STORE_PARMS macro.
options The following options are provided:
uid A user ID.
pwd A password for the user ID.
Alternatively, you can connect using a Properties object. The following properties may be specified. Each have the same meaning as in the explicit URL syntax above:
database
persist
persistfile
user
password