2 Managing the Client and Back-End Databases

The following sections describe how to create and manage the client database and how to connect to the back-end Oracle database:

2.1 Creating and Managing the Database for a Mobile Client

When you use the mobile client and mobile server to replicate data between the back-end Oracle database and your mobile device, a small database is created on your mobile device to contain the data—that is stored in tables known as snapshots. The snapshot tables are used to track the modifications that the client makes on the data, which is then replicated during the synchronization process to the back-end database. All of this activity is transparent to the client. Your application queries and modifies data using SQL as if interacting with any Oracle database.

The client database is automatically created on the first synchronization request. In addition, the data is replicated and updated with the data on the Oracle database automatically for you. See Section 2.3, "What is the Process for Setting Up a User for Synchronization?" in the Oracle Database Mobile Server Developer's Guide for techniques that can be used to create publication items on the mobile server, which then automatically creates snapshots on the client when you synchronize with the database.

2.2 Connecting to the Back-End Oracle Database

When you are connecting to the back-end Oracle database, use the JDBC driver. When connecting to the repository in the back-end Oracle database, provide a URL to locate the database. Use the Thin JDBC driver to connect to the back-end Oracle database. With the Thin JDBC driver, you can either provide the host, port and SID, the Oracle Net address or tnsnames entry.

The syntax for providing the host, port and SID is as follows:


For example, the following JDBC URL for the thin JDBC driver connects to my-pc.us.oracle.com on port 1521 with SID of orcl:


The syntax for using an Oracle Net address or tnsnames entry is as follows:


For example, the following JDBC URL for the thin JDBC driver connects to the MyDB tnsnames entry:


Alternatively, you could provide the full Oracle Net address, as follows:


If the mobile server repository is installed in an Oracle RAC database, then provide the JDBC URL for an Oracle RAC database, which can have more than one address for multiple Oracle databases in the cluster. The following is the URL structure for an Oracle RAC database address: