|Oracle® COM Automation Feature Developer's Guide
11g Release 2 (11.2) for Microsoft Windows
|PDF · Mobi · ePub|
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.
Note:Oracle Database 11g Release 2 (11.2) is the last database version that supports Oracle COM Automation feature. Oracle Database versions, which are released after Oracle Database 11g Release 2 (11.2), will not support Oracle COM Automation feature. You can continue to use Oracle COM Automation feature with existing Oracle Database versions that are covered under the lifetime support policy of Oracle.
This chapter contains these topics:
Oracle COM Automation Feature enables you to use Component Object Model (COM)-based components to customize and enhance the functionality of the Oracle database on Windows operating systems.
You can build your own custom components or use the thousands of prebuilt 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.
Oracle COM Automation Feature acts as a generic wrapper around the
Oracle COM Automation Feature externalizes all methods supported by the
COM objects expose properties, data attributes, and methods (functions that perform an action) to the developer.
IDispatch interface supports three basic operations for any COM object:
Gets the value of an exposed property
Sets the value of an exposed property
Invokes a method on an object
When an Oracle COM Automation Feature application programming interface (API) is invoked from PL/SQL or Java stored procedures, Oracle COM Automation Feature converts the parameters to the appropriate COM Automation data types and then invokes the corresponding
IDispatch API with the converted parameters.
See Also:Chapter 3, "Oracle COM Automation Feature Core Functionality" for descriptions of the data types 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 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.
Oracle COM Automation Feature is a powerful and enabling infrastructure technology for Oracle developers on Windows. It has the following advantages:
Ease of Development
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 can easily incorporate these APIs into your PL/SQL subprograms or Java programs.
Oracle COM Automation Feature enables you to leverage prebuilt COM components that have been developed in-house or by third-party independent software vendors (ISVs). In addition, there are thousands of existing COM components from which you can choose. The COM component market is expanding rapidly and offers solutions to many common programming problems.
Flexibility and Extensibility
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:
Exchange data among productivity applications, such as Microsoft Word, Microsoft Excel, and Microsoft PowerPoint.
Generate reports using Seagate Crystal Reports.
Send and receive e-mail with MAPI-compliant applications.
The possibilities for customization and extensibility of the database server are limitless.
Oracle COM Automation Feature enables you to deploy Oracle Database in a combined Oracle and Windows environment. You can be assured that Oracle COM Automation Feature integrates fully with and capitalizes on the services that are exposed by Windows, Microsoft BackOffice applications, and Microsoft Office applications.
Portability and Platform-Specific Requirements
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.
Figure 1-1 illustrates the interaction between an Oracle 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 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 functions in the C programming language that reside within a DLL. You can invoke Oracle COM Automation Feature APIs in the same manner in which you call a standard PL/SQL stored procedure or function.
Figure 1-2 shows an Oracle database invoking COM Automation external procedure APIs.
The database server invokes any of the COM Automation external procedure APIs as follows:
The PL/SQL interpreter passes the procedure name, the parameters, and the path name of the DLL to
extproc.exe file loads the DLL and executes the external procedure. Each of the COM Automation external procedure APIs in turn calls Win32 APIs that instantiate a COM object, set or get properties of a COM object, or invoke a method of a COM object.
The extproc.exe file acts 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 stop abruptly.
Oracle COM Automation Feature for Java is implemented by the Java Native Interface (JNI). The key components of this architecture are the
Automation class and the Java COM Proxy DLL,
VER is the release version.
The interface is the
Automation class, a Java proxy to the COM Automation server. The
Automation class provides the methods necessary for developers to manipulate COM objects through the
Figure 1-3 illustrates implementation of Oracle COM Automation Feature for Java.