13.3 IBM DB2 EveryplaceDB2e databases and IBM FastRecordStores (see Section 12.3) synchronize with backend DB2 Universal databases or any other JDBC data sources through the DB2e Sync server. In DB2e v8.1, multiple combinations of synchronization clients, transport mechanisms and backend data sources are supported through the adaptor architecture (Figure 13.4). Figure 13.4. The adaptor architecture in DB2 synchronization engine.![]() The synchronization client on the mobile device can handle DB2e databases, native PIM lists and files.The clientside synchronization engine communicates with the synchronization server via HTTP, WAP or Bluetooth. Both proprietary binary protocols and SyncML are supported.The synchronization server supports the DB2 Universal Database, any JDBC database as well as Domino and Exchange servers. We can start the Sync server from the Mobile Devices Administration Center in DB2e's server console. Using the administration center UI, we can create users and subscription sets, associate users with subscription sets, specify encryption levels, and define conflict resolution logic. On the client side, DB2e Sync runs natively on three mobile platforms: Palm OS, Windows CE, and Symbian OS. Using device-native GUIs, a mobile user can login to the Sync server, download the subscription sets, manage subscription sets, and synchronize mobile databases. For more information on how to configure and run the DB2e Sync server and client, please refer to DB2e documentation (see "Resources"). 13.3.1 Access DB2e Sync ProgrammaticallyThe above synchronization process requires human interaction with a standalone client program. That is not always convenient. DB2e provides a set of J2ME APIs that allow users to access the DB2e Sync server programmatically. Those Java APIs are just JNI wrappers over DB2e's native Sync methods. Listing 13.3 illustrates the use of such APIs. Listing 13.3. DB2e Sync client application
13.3.2 Sync with MIDP FastRecordStoreAs we had discussed in Chapter 12, Section 12.3, DB2e supports a mechanism to synchronize backend databases with its proprietary FastRecordStores on MIDP devices. The following code snippet (Listing 13.4) illustrates the synchronization process. If this is the first time we synchronize, a new FastRecordStore with the same table name will be created and populated with data rows from the table. Listing 13.4. Using DB2e Sync to synchronize MIDP FastRecordStore
|