Provides static methods to obtain basic configurations, create a new database, and connect to an existing database.
 Syntaxpublic class DatabaseManager
 MembersAll members of DatabaseManager class, including all inherited members.
| Name | Description | 
|---|---|
| Connects to an existing database based on a configuration set. | |
| Creates a Configuration object for a physical database store from a file on a J2ME device file system, and returns a ConfigFileME object. | |
| Creates a Configuration object for a non-persistent database store, and returns a ConfigNonPersist object. | |
| Creates a Configuration object for a RIM object store, and returns a ConfigObjectStore object. | |
| Creates a Configuration object for a record store as the physical database store, and returns a ConfigRecordStore object. | |
| Creates a new database based on a set of configurations, and connects to the database. | |
| Creates a FileTransfer object for transferring files to or from MobiLink. | |
| Creates a FileTransfer object for transferring UltraLite Java edition databases to or from MobiLink, and storing them into a RIM object store. | |
| Creates an SISListener object for server-initiated synchronizations. | |
| Closes this DatabaseManager object to release all connections and to shutdown all databases. | |
| Sets the language to use for error messages. | 
 RemarksThe following example demonstrates how to open an existing database or create a new one if it does not exist on the J2SE platform:
Connection conn;
ConfigFile config = DatabaseManager.createConfigurationFile(
        "test.ulj"
    );
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
} | 
                  
The following example demonstrates how to open an existing database or create a new one if it does not exist on a BlackBerry device:
Connection conn;
ConfigObjectStore config = DatabaseManager.createConfigurationObjectStore(
        "test.ulj"
    );
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
} | 
                  
The following example demonstrates how to open an existing database or create a new one if it does not exist on a BlackBerry media card:
Connection conn;
ConfigFileME config = DatabaseManager.createConfigurationFileME(
        "file:///SDCard/ulj/test.ulj"
    );
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
} | 
                  
The following example demonstrates how to open an existing database or create a new one if it does not exist on an Android device:
// Android Sample
Connection conn;
ConfigFileAndroid config = DatabaseManager.createConfigurationFileAndroid(
        "test.udb",
        getApplicationContext());
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
} | 
                  
 See alsoconnect method
createConfigurationFile method
createConfigurationFileAndroid method
createConfigurationFileME method [BlackBerry]
createConfigurationNonPersistent method [BlackBerry]
createConfigurationObjectStore method [BlackBerry]
createConfigurationRecordStore method [J2ME]
createDatabase method
createFileTransfer method
createObjectStoreTransfer method [BlackBerry]
createSISHTTPListener method [BlackBerry]
release method
setErrorLanguage method
![]()  | 
               
                   Discuss this page in DocCommentXchange.
                   
                | 
               Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 | 
