Oracle COM Automation Feature in Oracle9i

Features Overview

October 2001



Product Summary

The Oracle9i COM Automation Feature enables database programs to call and manipulate COM Automation servers, such as Microsoft Office and Visual Basic. It allows server-side programs to drive data and interaction with Windows-based COM clients. The feature provides PL/SQL and Java stored procedure packages that expose a set of application programming interfaces (APIs) to instantiate COM objects, get and set their properties, and invoke their methods. The COM Automation Feature has a variety of uses with Windows productivity applications and pre-built COM components. For example, in Figure 1, a PL/SQL trigger can be used to automatically compile sales data at the end of every month in a Microsoft Excel spreadsheet to be graphed.

Another usage example could involve Java stored procedures sending stock price email alerts to brokerage customers using Microsoft Outlook.

Database programmers can use the COM Automation Feature APIs rom PL/SQL and Java stored procedures, stored functions, and triggers. There are no restrictions as to where the client COM objects can reside. They can be either local to the database server or be remotely accessed via the Distributed Component Object Model (DCOM). The Java functionality, however, does not allow in-process COM Automation Servers to be used. Java developers can utilize dllhost to support in-process servers as out-of-process servers.

Components and Architecture

The Oracle COM Automation Feature acts as a generic wrapper around the OLE Automation interface, IDispatch. It externalizes all the methods the IDispatch interface supports. When the COM Automation Feature is invoked from PL/SQL or Java, it converts the passed parameters from its Oracle datatypes to the appropriate COM Automation datatypes. It then invokes the corresponding IDispatch interfaces with the converted parameters.


The Oracle COM Automation Feature provides a package of PL/SQL APIs, ORDCOM, for manipulating COM objects. These APIs are implemented as external procedures in a dynamic linked library (DLL) called orawpcom.dll.

Oracle supports external procedures that enable developers to call Third Generation Language (3GL) functions from server-based object type methods and stored procedures. External procedures are invoked exactly like standard PL/SQL. However, unlike standard PL/SQL where the body of the procedure is written in PL/SQL and stored in the database, external procedures are C functions that reside within a DLL. You can invoke Oracle COM Automation Feature APIs in the same manner as if you are calling standard PL/SQL.


Java support in the Oracle COM Automation Feature is implemented by the Java Native Interface (JNI). The architecture's key components are the Automation class and the Java COM Proxy DLL, orawcom.dll. The Automation class, a Java proxy to COM Automation servers, provides the methods necessary for developers to manipulate COM objects through the IDispatch interface. The Java-specific COM proxy orawcom.dll enables Java functions to invoke their corresponding COM functions.


The Oracle COM Automation Feature carries many benefits for Windows applications users:

  • Ease of Development - With the COM Automation Feature, Oracle users can manipulate data on Windows clients simply and quickly. PL/SQL and Java are easy to use languages that Oracle database users are familiar with. By integrating these langauges with popular Windows productivity applications and languages or pre-built COM components, programmers will be able to focus on developing the application business logic rather than the underlying communication plumbing between Oracle and COM.
  • Tight Windows Integration - Using Windows applications, such as Microsoft Word and Visual Basic, is very popular in business client computing. As such, Oracle has made data interaction with these applications seamless from an Oracle database. With PL/SQL or Java, Oracle database users can program against these Windows applications as if they were using a native COM-based programming language.
  • Server-side Programming - The COM Automation Feature allows server-side events and programs to manipulate COM objects. Server-side programming is important in the cases when data manipulation needs to originate from the database, rather than from client applications. This functionality is not available in the widely-used ODBC and ADO/OLE DB data access interfaces.




    Oracle Corporation
    World Headquarters
    500 Oracle Parkway
    Redwood Shores, CA 94065

    Worldwide Inquiries:
    Fax +1.650.506.7200

    Copyright © Oracle Corporation 2001
    All Rights Reserved

    This document is provided for informational purposes only, and the information herein is subject to change without notice. Please report any errors herein to Oracle Corporation. Oracle Corporation does not provide any warranties covering and specifically disclaims any liability in connection with this document.

    Oracle, Oracle9i, and PL/SQL are a trademarks of Oracle Corporation.

    All other company and product names mentioned are used for identification purposes only and may be trademarks of their respective owners.