Skip Headers
Oracle® Database Lite Developer's Guide for Java
10g (10.0.0)
Part No. B13811-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

1 Overview

This chapter provides an overview of native Java applications for developers. Topics include:

1.1 Concepts

Oracle Database Lite facilitates the development, deployment, and management of offline mobile database applications for a large number of mobile users. An offline mobile application is an application that can run on mobile devices without requiring constant connectivity to a server. An offline database application requires a local database on the mobile device whose content is a subset of data that is stored in the enterprise data server. The modifications made to the local database by the application are occasionally reconciled with server data. The technology used for reconciling changes between the mobile database and the enterprise database is known as data synchronization.

For more information about Oracle Database Lite concepts, refer the Oracle Database Lite Developer’s Guide.

1.2 Application Development Steps Overview

This section provides an overview of the Java application development process for mobile applications. Topics include:

1.2.1 Setup Enterprise Data Subset Definition

The enterprise data subset definition setup process can be accomplished by performing tasks in the phases listed below.

  1. Mobile application developers must first define the subset of enterprise data for users of mobile applications.

  2. The enterprise data subset is defined as a publication, which is instantiated as the Oracle Database Lite schema on the mobile client.

  3. The primary data subsetting mechanism of a publication is the publication item, which is a parameterized query that defines the data subset, based on specified parameter values.

  4. When a publication is instantiated, a snapshot is created for each publication item (with variables bound to values) in Oracle Database Lite.

Packaging Applications

After completing tasks under phases listed above, mobile application developers can develop mobile applications against Oracle Database Lite. Upon completion of application development and testing, developers can package applications to present them in a format which is ready to be published to Oracle Database Lite.

Provisioning Applications to Users

The provisioning process involves assigning privileges for application usage and associated data subsets to users. To provision an application to a user, the Mobile Server Administrator creates a subscription for a user, from the publication that is associated with an application.

Creating Application Subscriptions

To create a subscription, the Mobile Server Administrator must assign values for the subscription parameters of the publication. These values collectively determine the enterprise data subset for a user.

Generating Database Schema

When a user logs into the Mobile Server, the Mobile Server installs Oracle Database Lite on the client machine and creates a database or schema for each subscription that is associated with applications that are provisioned to a user. At this stage, database schema are populated with tables and rows that are retrieved from the server, based on subscription definitions. The Mobile Server also installs mobile applications on the client machine.

1.2.2 Develop the Application

Using the Mobile Development Kit, you can develop Java applications. You can build Java applications using Java Servlets, Java Server Pages (JSP), and Java Beans. After creating your Java applications, you must perform the following tasks.

  1. Create database objects in Oracle Database Lite.

  2. Write the application code.

    1. Set the CLASSPATH to include required libraries.

    2. Compile the Java Servlet and JavaBean.

    3. Install the JSP.

  3. Compile the application.

  4. Define the application and register the servlet.

    1. Start the Packaging Wizard in debug mode. Using the Command Prompt, enter the following:

      cd &fmv19;\mobile\sdk\bin

      wtgpack -d

      The Packaging Wizard appears. Using the Packaging Wizard, create a new application, select a platform, specify your Java application settings, select application files, compile JSP files, select your Java application servlets, and specify registry settings. For more information about the Packaging Wizard, see the Oracle Database Lite Tools and Utilities Guide.

  5. Run the application.

    To run your Java application, start the Mobile Client Web Server on the development computer. Using your Java browser, access your Java application and connect to the application's URL.

    The default port for the Mobile Client Web Server is 7070. To configure the port that will be used by the Mobile Client Web Server, change the port entry in the webtogo.ora file.

    &fmv27;\mobile\sdk\bin\webtogo.ora

    For information on how to edit the webtogo.ora file, see Section 11.3, "Editing the webtogo.ora File," in the Oracle Database Lite Administration and Deployment Guide.

    For additional information about configuration parameters in the webtogo.ora file, see Appendix B, "Mobile Server Configuration Paramters" in the Oracle Database Lite Administration and Deployment Guide.

    1. Start the Mobile Client Web Server. Using the Command Prompt, enter the following.

      cd &fmv31;\mobile\sdk\bin

      wtgdebug.exe

      The Mobile Client Web Server starts and reports which servlets are loaded. If your servlets contain any System.out.printIn() statements, the messages appear in this window.

    2. Start your web browser and connect to the following URL.

      http://your_machine:7070/

      The browser displays a list of applications that are currently known to the Web-to-Go system.

    3. Click your Java application.

The Mobile Development Kit for Web-to-Go always uses Oracle Database Lite as the development database. You can create one yourself using the CREATEDB statement.

The Mobile Development Kit for Web-to-Go also uses a web server that is referred to as the Mobile Client Web Server.

During the development phase, your Java application's servlet stores application items in Oracle Database Lite. During the deployment phase, you must copy the database objects from Oracle Database Lite to the Oracle database.

1.2.3 Package the Application

To prepare Java applications for publishing to the Mobile Server, you must package these applications using the Packaging Wizard. The following steps enable you to publish your Java applications.

  1. Define your Java application using the Packaging Wizard.

    1. To define Java applications, start the Packaging Wizard using the Command Prompt and enter the following.

      cd &fmv45;\mobile\sdk\bin

      wtgpack

    2. Choose Edit an existing application and select your Java application from the list displayed.

    3. Review application information and settings provided under the platform, application, files, servlets, and database tabs.

  2. Using the Database tab, define the application connection to the Oracle database.

  3. Using the Roles tab, define application roles.

  4. Using the Snapshots tab, define snapshots for your Java applications. To define snapshots, import table definitions from the development database.

  5. Using the Sequences tab, define sequences that your Java application will use in offline mode. At a later stage, you can create the actual sequences in the Oracle database. During synchronization, Web-to-Go automatically creates a local copy of your Java application's sequence on your client.

  6. Create SQL files for your Java application. After you specify sequences, the Application Definition Completed dialog appears. Using this dialog, you can choose to generate SQL scripts for database objects.

  7. You are now ready to package your Java application. Using the Application Definition Completed dialog, you can package your Java application into a jar file.

1.2.4 Publish the Application

After packaging your Java applications, you are ready to publish them. The following steps enable you to publish your Java applications.

  1. Create the 'Table Owner' account. The 'Table Owner' is effectively the database user who will own the Java application that you just packaged.

  2. Create database objects in the Oracle database by running the SQL master script. The script creates your Java application's table and its corresponding sequence.

  3. Using the SQL script, start the Mobile Server.

  4. Login to the Mobile Server and start the Mobile Manager.

  5. Upload the jar file containing your Java application.

1.2.5 Test the Application

Before you can test your Java application, you must administer your Java applications by creating users, setting application properties, granting user access to applications, and defining snapshot template values for a user's snapshot template variables.

After administering Java applications as indicated above, you must install the Mobile Client for Web-to-Go using the Mobile Client Setup program, login to the Mobile Client for Web-to-Go, and synchronize the Mobile Client for Web-to-Go.

For detailed information on how to develop, package, publish, and test your applications, refer Chapter 2, "Application Development".

1.3 Configuring the Development System

This section discusses how to configure the development system. Topics include:

1.3.1 Java Development Kit (JDK)

As part of the development system's configuration, install the Java Development Kit (JDK) 1.3.1 or higher.

1.3.2 Install and Configure the Oracle Database or Enterprise Database

Install the appropriate Oracle Database or Enterprise Database. For more information, refer the Oracle Database Lite Installation and Configuration Guide for Windows NT/2000/XP.

1.3.3 Install the Mobile Server

For more information on how to install the Mobile Server, refer the Oracle Database Lite Installation and Configuration Guide for Windows NT/2000/XPs.

1.3.4 Configure the Mobile Server

For more information, refer the Oracle Database Lite Installation and Configuration Guide for Windows NT/2000/XP.

1.3.5 Install the Mobile Development Kit

For more information on how to install the Mobile Development Kit, refer the Oracle Database Lite Installation and Configuration Guide for Windows NT/2000/XP.


Note:

Section 2.2 to Section 2.5 are only required when you synchronize data between client and server databases.