Skip Headers
Oracle® Database Lite Developer's Guide
10g (10.0.0)
Part No. B13788-01
  Go To Index



Title and Copyright Information

Send Us Your Comments


Intended Audience
Documentation Accessibility

1 Overview

1.1 Introduction
1.2 Oracle Database Lite 10g Application Model and Architecture
1.2.1 Oracle Database Lite RDBMS
1.2.2 Mobile Sync
1.2.3 Mobile Server
1.2.4 Message Generator and Processor (MGP)
1.2.5 Mobile Server Repository
1.3 Mobile Development Kit (MDK)
1.3.1 Mobile SQL (MSQL)
1.3.2 Using the Packaging Wizard
1.4 Supported Platforms
1.5 Java Support
1.6 Data Source Name

2 The Oracle Database Lite RDBMS

2.1 Introduction
2.2 Development Interfaces
2.2.1 Development Interface Overview JDBC Starting a Multi User Oracle Database Lite Database Service Accessing the Multi User Oracle Database Lite 10g Database Service ODBC SODA
2.2.2 Mobile Sync Client Module Application Programming Interfaces (APIs)
2.2.3 Oracle Database Lite Load APIs
2.2.4 Oracle Database Lite Load Utility (OLLOAD)
2.2.5 ADO.NET
2.3 Using the Starter Database
2.4 Working With Your Database
2.4.1 Creating a New Database
2.4.2 Creating a Data Source Name with ODBC Administrator
2.4.3 Creating a New Database Using the Command-Line Utility
2.4.4 Connecting to a New Database
2.5 Creating Multiple Users
2.5.1 Pre-defined Roles
2.5.2 Creating Users
2.5.3 Dropping Users
2.5.4 Changing Passwords
2.5.5 Granting Roles
2.5.6 Granting Privileges
2.5.7 Revoking Roles
2.5.8 Revoking Privileges
2.5.9 Building Demo Tables
2.5.10 Populate Your Database Using Mobile SQL
2.5.11 Backing Up a Database
2.5.12 Encrypting and Decrypting a Database
2.6 Oracle Database Lite Transaction Support
2.6.1 Atomicity
2.6.2 Consistency
2.6.3 Isolation Durability Locking Changing the Default Isolation Level Supported Combinations of Isolation Levels and Cursor Types
2.6.4 Tuning the Application
2.7 Support for Linguistic Sort
2.7.1 Creating Linguistic Sort Enabled Databases
2.7.2 How Collation Works
2.7.3 Collation Element Examples Sorting Normal Characters Reverse Sorting of French Accents Sorting Contracting Characters Sorting Expanding Characters Sorting Numeric Characters
2.8 Creating Snapshot Definitions
2.8.1 Creating a Snapshot Definition Declaratively
2.8.2 Creating the Snapshot Definition Programmatically
2.9 Using Oracle Database Lite Samples
2.9.1 Overview
2.9.2 BLOB Manager Example Notes
2.9.3 Running the Visual Basic Sample Application Open Visual Basic View the Sample Application Tables and Data Open the Sample Application View and Manipulate the Data in the EMP Table
2.9.4 ODBC Examples What the Examples Do
2.10 Limitations
2.11 Tracing
2.11.1 Enabling Trace Output
2.11.2 Basic Functions
2.11.3 SQL Tracing The Tid Output SQL Statement Output Compilation Time Output Bind Values Output Explain Plan Output Temporary Table Created Output Table Name Output Temporary Table Sorted Output First Fetch Time Output

3 Synchronization

3.1 Overview
3.1.1 Synchronization Concepts Publication Item Publication Application Subscription Data Subsetting Shared Maps
3.1.2 Synchronization Example
3.2 Synchronization Process
3.2.1 Fast Refresh Synchronization Client Upload and Download Operations Mobile Server Apply Operation Mobile Server Compose Operation
3.2.2 Complete Refresh Synchronization
3.2.3 Synchronizing an Encrypted Database
3.3 Mobile Sync Application Programming Interfaces (APIs)
3.4 The Publish and Subscribe Model and Oracle Database Lite Synchronization
3.4.1 The Publish and Subscribe Model Step by Step
3.5 Using Consolidator to Define the Example
3.5.2 Create Required Tables Using Standard JDBC
3.5.3 Connecting to the Mobile Server
3.5.4 Creating Publications CreatePublication
3.5.5 Creating Publication Items CreatePublicationItem Defining Publication Items for Updatable Multi-table Views Data Subsetting
3.5.6 Sequence Support
3.5.7 Defining Client Subscription Parameters for Publications SetSubscriptionParameter
3.5.8 Creating Publication Item Indexes CreatePublicationItemIndex Define Client Indexes
3.5.9 Adding Publication Items to a Publication AddPublicationItem Defining Conflict Rules Using Table Weight
3.5.10 Creating Users createUser
3.5.11 Drop User dropUser
3.5.12 Subscribing Users to a Publication CreateSubscription
3.5.13 Instantiating a Subscription InstantiateSubscription
3.6 Other Standard Consolidator Functionality
3.6.1 Client Device Database DDL Operations
3.6.2 Change Password setPassword
3.6.3 Remote Database Link Support Publishing Synonyms for the Remote Object Using CreatePublicationItem Creating a Dependency Hint Remove a Dependency Hint
3.7 Advanced Features for Customizing Consolidator
3.7.1 Compose Phase Customization Using MyCompose Extending MyCompose as a User Defined Sub-Class Primary MyCompose Methods Subsidiary MyCompose Methods Consolidator API Methods for Registering MyCompose Sub-Classes
3.7.2 Sync Discovery API getDownloadInfo Method DownloadInfo Class Access Methods PublicationSize Class
3.7.3 Map Table Partition APIs Create a Map Table Partition Add Map Table Partitions Drop a Map Table Partition Drop All Map Table Partitions Merge Map Table Partitions
3.7.4 Modifying a Publication Item Using AlterPublicationItem Alter Publication Item
3.7.5 Fast Refresh and Update Operation for Multi-Table Publications (Views) Updatable Parent Tables Using Parent Table Hints and INSTEAD OF Triggers Fast Refresh for Views Complete Refresh for Views
3.7.6 Virtual Primary Key Create Virtual Primary Key Column Drop Virtual Primary Key Column
3.7.7 Caching Publication Item Queries Enabling Publication Item Query Caching Disabling Publication Item Query Caching
3.7.8 Binding User-Defined PL/SQL Procedures
3.7.9 Queue Interface for Customizing Replication Queue Interface Operation Queue Creation Queue Interface PL/SQL Procedure CreateQueuePublicationItem API Defining a PL/SQL Package Outside the Repository
3.7.10 Null Sync Callout
3.7.11 Foreign Key Constraints in Updatable Publication Items Foreign Key Constraint Violation Example Avoiding Constraint Violations with BeforeApply and After Apply Avoiding Constraint Violations with Table Weights
3.7.12 Callback Customization for Before and After Compose/Apply
3.7.13 Callback Customization for DML Operations DML Procedure Example
3.7.14 Restricting Predicate
3.7.15 Priority-Based Replication
3.7.16 Shared Maps Concepts Performance Attributes Usage Compatibility and Migration
3.8 Synchronization Errors and Conflicts
3.8.1 Versioning
3.8.2 Winning Rules
3.8.3 Resolving Conflicts Using the Error Queue Execute Transaction Purge Transaction
3.8.4 Space Constraints
3.9 Mapping Datatypes Between the Oracle Server and Clients
3.9.1 Oracle Database Lite Datatypes

4 Developing Mobile Web Applications

4.1 Setting up the Mobile Client
4.2 Developing and Testing the Application
4.2.1 Building Web-to-Go Applications Static Components Dynamic Components Database Components Database Connections
4.2.2 Application Roles
4.2.3 Developing JavaServer Pages Mobile Server or Mobile Development Kit Web Server Mobile Client for Web-to-Go
4.2.4 Developing Java Servlets for Web-to-Go Limitations Accessing Applications on the Mobile Development Kit for Web-to-Go Creating a Servlet Running a Servlet Debugging a Servlet Accessing the Schema Directly in Oracle Database Lite
4.2.5 Using Web-to-Go Applets Creating the Web-to-Go Applet Creating the HTML Page for the Applet
4.2.6 Developing Applet JDBC Communication getConnection() Design Issue
4.2.7 Developing Applet Servlet Communication Creating the Web-to-Go Servlet
4.2.8 Debugging Web-to-Go Applications Running Sample 1 Using Oracle9i JDeveloper
4.2.9 Customizing the Workspace Application Web-to-Go Parameters Sample Workspace
4.2.10 Using the Mobile Server Admin API

5 Native Application Development

5.1 Supported Platforms
5.2 Java Support
5.3 Data Source Name
5.4 Mobile Sync Application Programming Interfaces (APIs)
5.4.1 COM Interface Features and Components ISync Interface ISyncOption Interface Selective Synchronization COM Interface SyncParam Settings COM Interface TransportParam Parameters ISyncProgressListener Interface
5.4.2 C/C++ Interface ocSessionInit ocSessionTerm ocSaveUserInfo ocDoSynchronize ocSetTableSyncFlag ocGetPublication C/C++ Data Structures
5.5 Using the Packaging Wizard

6 Oracle Database Lite 10g ADO.NET Provider

6.1 Classes
6.1.1 OracleConnection
6.1.2 Transaction Management
6.1.3 OracleCommand
6.1.4 OracleParameter and Prepared Statements Parameters
6.1.5 OracleBlob and Large Object Support
6.1.6 OracleSync and Data Synchronization
6.2 Running the Demo
6.3 Limitations
6.3.1 Thread Safety

7 Developing Mobile Applications for Palm OS Devices

7.1 Installing Oracle Database Lite Runtime on the Device
7.2 Uninstalling or Replacing Oracle Database Lite Runtime
7.3 Running Oracle Database Lite on Palm OS Emulator
7.4 Running Oracle Database Lite on Palm OS Simulator
7.5 Using Oracle Database Lite Base Libraries
7.6 Building a SODA Application
7.7 Building a SODA Forms Application
7.8 Building an ODBC Application
7.9 Packaging your Application with Oracle Database Lite Runtime
7.10 Customizing Oracle Database Lite Runtime
7.11 Palm Shared Library Manager (PSLM)

8 Palm Shared Library Manager (PSLM)

8.1 Overview
8.2 Trying out PSLM
8.3 Writing a PSLM Library
8.4 Building a Shared Library Project
8.5 Calling a PSLM Library from Your Application
8.6 Building an Application Using PSLM
8.7 Exceptions Across Modules
8.8 Cloaked Shared Libraries
8.9 Patching the CodeWarrior Runtime

9 Using Mobile Sync for Palm

9.1 Configuring mSync
9.2 Using HotSync to Synchronize Data with the Mobile Server
9.2.1 Configuring HotSync for a PalmOS Device
9.2.2 HotSync Timeout Errors
9.2.3 Configuring PalmOS Emulator for HotSync
9.3 Using Network Sync
9.3.1 Synchronizing Using a Cradle and Windows Desktop
9.3.2 Network Sync With PalmOS Emulator

10 Building Offline Mobile Applications for Win32: A Tutorial

10.1 Overview
10.2 Developing Offline Mobile Applications for Win32
10.2.1 Command Sequence Step 1. Create TASK Table on the Server Database Step 2. Define a Publication Item and Publish the Application Step 3. Create Users and Subscriptions Step 4. Install the Oracle Database Lite 10g Client and the Mobile Field Service Application and Data Step 5. Browse the TASK Snapshot and Update a Row Step 6. Synchronize the Change with the Server Step 7. Check your changes on the server and modify a server record Step 8. Synchronize again to get the server changes Step 9. Develop your Mobile Field Service Application Using Oracle Database Lite Step 10. Republish the Application with the Application Program

11 Building Offline Mobile Applications for Windows CE: A Tutorial

11.1 Overview
11.1.1 Before You Start Application Development Computer Requirements Client Device Requirements
11.2 Developing the Application
11.2.1 Creating Database Objects in the Oracle Server The Pocket PC Transport Application Database Objects
11.2.2 Writing the Application Code Transport Module (Transport.vb) Main Form (frmMain.vb) View Packages (frmView.vb) Create Package (frmNew.vb)
11.2.3 Compiling the Application Creating CAB Files Installing the Application from the CAB File
11.3 Packaging and Publishing the Application
11.3.1 Defining the Application Using the Packaging Wizard Creating a New Application
11.3.2 Defining the Application Connection to the Oracle Database Server
11.3.3 Defining Snapshots
11.3.4 Publishing the Application
11.4 Administering the Application
11.4.1 Starting the Mobile Server
11.4.2 Launching the Mobile Manager
11.4.3 Creating a New User
11.4.4 Setting the Application Properties
11.4.5 Granting User Access to the Application
11.4.6 Starting the Message Generator and Processor (MGP)
11.5 Running the Application on the Pocket PC
11.5.1 Installing the Oracle Database Lite Mobile Client for Pocket PC
11.5.2 Installing and Synchronizing the Transport Application and Data

12 Building Mobile Web Applications: A Tutorial

12.1 Overview
12.1.1 Before You Start Development Computer Requirements Client Computer Requirements
12.2 Developing the Application
12.2.1 Step 1: Creating Database Objects in Oracle Database Lite The To Do List Application Database Objects Required Action
12.2.2 Step 2: Compiling the Application Required Action
12.2.3 Step 3: Defining the Application and Registering the Servlet The Packaging Wizard Required Action
12.2.4 Step 4: Conducting a Trial Run The Mobile Development Kit for Web-to-Go Web Server Required Action
12.3 Packaging the Application
12.3.1 Step 1: Defining the Application The Packaging Wizard Required Action
12.3.2 Step 2: Specifying Database Details Required Action
12.3.3 Step 3: Defining the Snapshot The Snapshots Tab Required Action
12.3.4 Step 4: Defining Sequences
12.3.5 Step 5: Creating SQL Files for the Application Required Action
12.3.6 Step 6: Package the Application Required Action
12.4 Publishing the Application
12.4.1 Step1: Create the Table Owner Account
12.4.2 Step 2: Create the Database Objects in the Oracle Database Required Action
12.4.3 Step 3: Start the Mobile Server Required Action
12.4.4 Step 4: Log on to the Mobile Server and Start the Mobile Manager Required Action
12.4.5 Step 5: Upload the Application Required Action
12.5 Administering the Application
12.5.1 Step 1: Starting the Mobile Manager Required Action
12.5.2 Step 2: Using the Mobile Manager to Create a New User Required Action
12.5.3 Step 3: Setting Application Properties Required Action
12.5.4 Step 4: Granting User Access to the Application Required Action
12.5.5 Step 5: Defining Snapshot Template Values for the User Required Action
12.6 Running the Application on the Mobile Client for Web-to-Go
12.6.1 Step 1: Installing the Mobile Client for Web-to-Go Required Action
12.6.2 Step 2: Logging into the Mobile Client for Web-to-Go Required Action
12.6.3 Step 3: Synchronizing the Mobile Client for Web-to-Go Required Action

13 Building Offline Mobile Web Applications Using BC4J: A Tutorial

13.1 Overview
13.1.1 Before You Start Development Computer Requirements
13.2 Developing the Application
13.2.1 Creating the Database Connection
13.2.2 Creating the BC4J Component
13.2.3 Configuring the BC4J Component to Use the WTGJdbc Connection
13.2.4 Building and Deploying the BC4J Component as a Simple Archive
13.2.5 Writing the JSP Application to Access the BC4J Component
13.2.6 Deploying the JSP Application as a Simple Archive
13.3 Packaging the JSP Application
13.4 Publishing and Configuring the JSP Application from the Mobile Manager
13.5 Testing the BC4J Application
13.6 Running the BC4J Application on the Mobile Client for Web-to-Go
13.7 Deploying the Sample Application

A Optimizing SQL Queries

A.1 Optimizing Single-Table Queries
A.2 Optimizing Join Queries
A.2.1 Create an Index on the Join Column(s) of the Inner Table
A.2.2 Bypassing the Query Optimizer
A.3 Optimizing with Order By and Group By Clauses
A.3.1 IN Subquery Conversion
A.3.2 ORDER BY Optimization with No GROUP BY
A.3.3 GROUP BY Optimization with No ORDER BY
A.3.4 ORDER BY Optimization with GROUP BY
A.3.5 Cache Subquery Results

B Oracle Database Lite Load Application Programming Interfaces (APIs)

B.1 Overview
B.2 Oracle Database Lite Load APIs
B.2.1 Connecting to the Database: olConnect
B.2.2 Disconnecting from the Database: olDisconnect
B.2.3 Deleting All Rows from a Table: olTruncate
B.2.4 Setting Parameters for Load and Dump Operations: olSet
B.2.5 Loading Data: olLoad
B.2.6 Dumping Data: olDump
B.2.7 Compiling
B.2.8 Linking
B.3 File Format
B.3.1 Header Format
B.3.2 Parameters
B.3.3 Data Format
B.3.3.1 CSV Format
B.3.3.2 FixedAscii Format
B.4 Limitations

C Web-to-Go Sample Applications

C.1 Introduction
C.1.1 The Mobile Server
C.1.2 The Mobile Development Kit for Web-to-Go
C.1.3 Accessing Sample Programs from the Mobile Development Kit for Web-to-Go
C.1.4 Accessing Sample Programs from the Mobile Server
C.2 Sample 1 - Hello World
C.2.1 Source Code Location
C.2.2 Application Files
C.3 Sample 3 - Recording Tracker
C.3.1 Using Sample 3
C.3.2 Sample 3 Database Tables
C.3.3 Sample 3 Servlets
C.3.4 Sample 3 Resource Bundle
C.3.5 Source Code Location
C.3.6 Application Files
C.4 Sample 4 - Hello Applet
C.4.1 Sample 4 Servlets
C.4.2 Source Code Location
C.4.3 Application Files
C.5 Sample 6 - Image Gallery
C.5.1 Source Code Location
C.5.2 Application Files
C.6 Sample 7 - Employee Data Applet
C.6.1 Source Code Location
C.6.2 Application Files

D ODBC Support on Palm

D.1 ODBC Support
D.1.1 SQLAllocConnect
D.1.2 SQLAllocEnv
D.1.3 SQLAllocHandle
D.1.4 SQLAllocStmt
D.1.5 SQLFreeConnect
D.1.6 SQLFreeEnv
D.1.7 SQLFreeHandle
D.1.8 SQLFreeStmt
D.1.9 SQLConnect
D.1.10 SQLDisconnect
D.1.11 SQLBindParameter
D.1.12 SQLPrepare
D.1.13 SQLExecDirect
D.1.14 SQLExecute
D.1.15 SQLFetch
D.1.16 SQLBindCol
D.1.17 SQLDescribeCol
D.1.18 SQLError
D.1.19 SQLGetData
D.1.20 SQLNumResultCols
D.1.21 SQLRowCount
D.1.22 SQLTransact