====================================================
Oracle COM Automation for Java 11.2.0.1.0 Production
====================================================

 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 

This document provides information that supplements the Oracle COM Automation
documentation. This document lists the steps to install and configure the 
Oracle COM Automation Feature for Java.

Oracle COM Automation Feature for Java includes the following components:

* Oracle COM Automation for Java feature (orawcomVER.dll)
* Oracle COM Automation Java classes     (orawcom.jar)
* An Oracle to Microsoft Word data exchange solution


Installation of Oracle COM Automation Feature for Java
======================================================
The following steps describe how to install the Oracle COM Automation Feature 
for Java:

1. Open an MS-DOS command prompt.

2. Use the following command to change the directory to com\java:
   cd ORACLE_BASE\ORACLE_HOME\com\java

3. Connect to the database as system using SQL*Plus. For example:                                     
   sqlplus system/manager

4. From the SQL*Plus prompt, execute grant.sql script with the name of the user 
   that will be using Oracle COM  Automation for Java. You may need to 
   capitalize all the letters in the user's name. For example:          
   @grant.sql HR

5. Load the COM Automation Java classes into the desired database schema using 
   the loadjava tool.For example:
   loadjava -force -resolve -user hr/hr orawcom.jar


Solutions for Oracle COM Automation Feature for Java
====================================================
As part of Oracle COM Automation Feature for Java, several solutions are 
provided to give you an idea of how to use the Oracle COM Automation Feature for
Java to build solutions. These solutions are provided in the following ways:

*	As examples showing how to use the Oracle COM Automation Feature for Java
*	As a foundation upon which you can build more customized, complex applications
  that use Oracle COM Automation Feature for Java.

Microsoft Word Solution
=======================
The following sections describe how to install the Microsoft Word Solution and 
the Application Programming Interfaces (APIs) that it exposes. This solution is 
provided as an example of the types of solutions that can be built with Oracle 
database and Microsoft Word.

The Microsoft Word Solution provides a Java class (TestWORD) for manipulating 
Microsoft Word. The Microsoft Word Solution includes a static method in the  
TestWORD class to demonstrate the capabilities of exchanging data between 
Oracle database and Microsoft Word. The test static method exchanges data from
the EMPLOYEES table in Oracle database to a Microsoft Word document. 

You should invoke this static method after installing the solution.

This demo relies on the HR schema in the common schema.

Installing the Microsoft Word Solution
----------------------------------------------
Microsoft Word must be installed on the local machine for this solution to 
work properly. The following steps describe how to install the Microsoft 
Word Solution:

1.	Open an MS-DOS command prompt.

2.	Use the following command to change the directory to com\java\demos:
     cd ORACLE_BASE\ORACLE_HOME\com\java\demos

3.	Load the TestWORD Java classes into the desired database schema using the 
    loadjava tool. For example:
    loadjava -force -resolve -user hr/hr TestWORD.class

4.	Connect to the database using SQL*Plus. For example:
    sqlplus hr/hr

5.	From the SQL*Plus prompt, create the call specification in the following way:
    @TestWORD.sql

Using the Microsoft Word Solution
------------------------------------------
The following steps describe how to execute the Microsoft Word solution:

1.	Open an MS-DOS command prompt.

2.	Connect to the database using SQL*Plus. For example:
    sqlplus hr/hr

3.	Use the following commands to allow SQL*Plus to display output from the Java
    program:
    set SERVEROUTPUT on
    call dbms_java.set_output(100000);

4.	Invoke the Java code:
    call TestWORD(); 
    This code will create a Word document (worddemoj.doc) in the c:\. The 
    document will contain data from the EMPLOYEES table in Oracle database.

5.	Open the worddemoj.doc file to see its content.


Known Bugs
==========
At present, you cannot call the methods of Oracle COM Automation Feature for 
Java that display a window, message box, or dialog box.  

Workaround:
==========

Avoid calling methods that display such dialog boxes. For 
example, the Microsoft Excel solution appends the time stamp to the filename 
(For example, excelxxxxx.xls) to ensure that no two files are named the same. 
Excel displays an overwrite dialog box, if a file has the same name, when you 
attempt to save it using Oracle COM Automation. Microsoft Word does not do this.
