|Oracle COM Automation Feature Developer's Guide
Release 9.0.1 for Windows NT
Part Number A90169-01
This chapter describes the Oracle COM Automation Feature Software Development Kit (SDK) and provides an overview of the product. Read this chapter before installing or using Oracle COM Automation Feature.
This chapter contains these topics:
Oracle COM Automation Feature enables you to use COM-based components to customize and enhance the functionality of the Oracle database server on Windows NT and Windows 2000.
You can build your own custom components or use the thousands of pre-built components that are available from third-party independent software vendors (ISVs).
Oracle COM Automation Feature provides a mechanism to manipulate COM objects through either PL/SQL or Java. It acts as a generic wrapper around the
IDispatchinterface supports three basic operations for any COM object:
When an Oracle COM Automation Feature API is invoked from PL/SQL or Java Stored Procedures, the feature converts the parameters to the appropriate COM Automation datatypes and then invokes the corresponding
IDispatch API with the converted parameters.
Chapter 3, "Oracle COM Automation Feature Core Functionality" for descriptions of the datatypes and APIs
Oracle COM Automation Feature for PL/SQL provides a PL/SQL package and exposes a set of application programming interfaces (APIs) to instantiate COM objects. Developers can call these APIs from PL/SQL subprograms, stored procedures, stored functions, or triggers to manipulate COM objects.
There are no restrictions concerning where these COM objects reside. They can be local to the database server or accessed remotely through the Distributed Component Object Model (DCOM).
Oracle COM Automation Feature for Java provides a set of Java APIs to instantiate COM objects. Developers can call these APIs from Java stored procedures, Java functions, or Java triggers to manipulate COM objects.
Oracle COM Automation Feature for Java does not allow in-process COM Automation servers. Developers can use
dllhost to support in-process servers as out-of-process servers.
Oracle COM Automation Feature is a powerful and enabling infrastructure technology for Oracle developers on Windows NT and Windows 2000. It provides these compelling benefits:
Oracle COM Automation Feature exposes a simple set of APIs to manipulate COM objects. If you are familiar with COM and Microsoft Visual Basic, you will have no problems incorporating these APIs into your PL/SQL subprograms or Java programs.
Oracle COM Automation Feature enables you to leverage pre-built COM components that have been developed in-house or by third-party independent software vendors (ISVs). In addition, there are already thousands of preexisting COM components from which you can choose. The COM component market is expanding rapidly and already offers solutions to many of the most common problems that programmers need to solve.
You can use Oracle COM Automation Feature to customize and enhance the functionality of the database server. Through the use of COM components, the Oracle database can be customized to:
The possibilities for customization and extensibility of the database server are limitless.
Oracle COM Automation Feature enables you to deploy Oracle in a combined Oracle and Windows environment. You can be assured that Oracle integrates fully with and capitalizes on the services that are exposed by Windows NT, Windows 2000, Microsoft BackOffice applications, and Microsoft Office applications.
Applications using Oracle COM Automation Feature are written in Java or PL/SQL, which are platform-independent. Only the database instance that needs to invoke COM components must be run on Windows NT or 2000.
Figure 1-1, "Oracle COM Interaction" illustrates the interaction between an Oracle9i database with Oracle COM Automation Feature, client applications, and server applications.
The architectural differences between Oracle COM Automation Feature for PL/SQL and for Java are described in the next two sections.
Oracle COM Automation Feature for PL/SQL provides a package of PL/SQL APIs for manipulating COM objects. These APIs are implemented as external procedures in a dynamic linked library (DLL).
Oracle9i 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 stored procedures. However, unlike standard PL/SQL procedures 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 a standard PL/SQL stored procedure or function.
Figure 1-2, "COM Automation Feature Architecture for PL/SQL" shows an Oracle9i database invoking COM Automation external procedure APIs.
The database server invokes any of the COM Automation external procedure APIs as follows:
extproc.exe, if it has not already been started for the current user session.
extproc.exeloads the DLL and executes the external procedure. Each of the COM Automation external procedure APIs in turn call Win32 APIs that instantiate a COM object, set or get properties of a COM object, or invoke a method of a COM object.
extproc.exeacts as an intermediary and handles any interaction between Oracle COM Automation Feature and the database server.
The dependence on external procedures by Oracle COM Automation Feature for PL/SQL has implications for the availability of the database server.
You do not jeopardize the availability of the database server by using Oracle COM Automation Feature and custom or third-party COM objects in a production environment. Oracle COM Automation Feature operates outside of the Oracle kernel's address space. This safeguards the Oracle database from COM objects that crash unexpectedly.
Oracle COM Automation Feature for Java is implemented by the Java Native Interface (JNI) as shown in Figure 1-3, "COM Automation Feature Architecture for Java".
The key components of this architecture are the
Automation class and the Java COM Proxy DLL,
The interface is the
Automation class, a Java proxy to COM Automation server. The
Automation class provides the methods necessary for developers to manipulate COM objects through the
The Java-specific COM proxy,
orawcom.dll, enables Java functions to invoke their corresponding COM functions.
Oracle COM Automation Feature for Java invokes COM components from the database server. However, these COM components are run outside of the Oracle9i database process. This design prevents unstable COM components from interfering with the database process.