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) » UltraLiteJ » UltraLiteJ Reference » UltraLiteJ API reference

 

DatabaseManager class

Provides static methods to obtain basic configurations, create a new database, and connect to an existing database.

Syntax
public DatabaseManager
Remarks

The following examples demonstrate how to open an existing database, and create a new one if it does not exist.

This example works with J2ME devices:

Connection conn;
ConfigRecordStore config = DatabaseManager.createConfigurationRecordStore(
    "test.ulj"
    );
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
}

This example works with J2ME BlackBerry devices:

Connection conn;
ConfigObjectStore config = DatabaseManager.createConfigurationObjectStore(
    "test.ulj"
);
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
}

This example works with J2SE devices:

Connection conn;
ConfigFile config = DatabaseManager.createConfigurationFile(
    "test.ulj"
);
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
}
Members

All members of DatabaseManager, including all inherited members.


connect method
createConfigurationFile method
createConfigurationNonPersistent method
createConfigurationObjectStore function (J2ME BlackBerry only)
createConfigurationRecordStore function (J2ME only)
createDatabase method
createSISHTTPListener function (J2ME BlackBerry only)
release method
setErrorLanguage method