2015年7月22日 星期三

使用 JDAPI 開發 Oracle Form 程式: 開發環境安裝及設定

hychen39@gmail.com 
7/21/2015 

1. 安裝 Oracle Form Developer 10g (10.1.2)。一定要安裝 form developer,因為 frmjdapi.jar 在執行時會去 [ORACLE _HOME]\bin 下的目錄去呼叫 .dll 程式。ORACLE_HOME 為一環境變數,指向form developer 安裝的目錄。

2. 安裝 Netbeans。 WinXP + Form 10gR2 的環境下,安裝 Netbeans 7.2 + JDK 7u79 比較穩。

3. 在 Netbean 中新增一 Java Application 專案 。

4. 將 frmjdapi.jar 加入專案中。 frmjdapi.jar 的位置在 [ORACLE_HOME]\forms\java。


 若沒安裝 form developer,只有將 frmjdapi.jar 加入到專案中,則執行 jar 檔時會出現錯誤:




JDAPI java doc 載 (10gR2)

Oracle Forms 10g R2 Technical Information

有關 JDAPI 的說明:
Use Java to Access your Forms Files (by JDAPI)
The Oracle Forms Java Design-Time Application Programming Interface (JDAPI) lets Java programmers create, load, edit, save, and compile Forms module files (.fmb, .mmb, .olb, and .pll files) from self-written Java programs. Forms module files are normally created and edited using Forms Developer. JDAPI gives you access to almost all of the Forms Developer functionality. Because it is a programmatic interface and not an interactive development environment, JDAPI is an ideal tool for writing scripts that perform repetitive tasks on large numbers of Forms module files. For example, using JDAPI, you can make global changes to many Forms modules -- build utilities such as batch compilers or difference analyzers, create custom documentation, or perform impact analysis.



以下為從 Oracle Forms 10g (10.1.2) 的 online help 節錄出的 JDAPI 的介紹:




Programming Oracle Forms with JDAPI

JDAPI (Java Design-time API) is a Java 2 API for programmatically loading, creating, manipulating, saving and compiling Oracle Forms applications. It is built on top of the Forms C API and gives Java programmers a way to work with Forms without needing to learn C. Likewise, JDAPI is a complementary tool to the Form Builder and can be used to programmatically accomplish anything which can be achieved visually using the Builder.
JDAPI is not a run-time API and cannot be used to program, interact with or control running Forms applications.
Oracle Forms is an object-based 4GL (declarative) development tool for building GUI database applications. All the components of the environment are represented in the development environment as individual, self-contained objects, that have properties which define their appearance and behavior. These objects are normally created and manipulated visually using the Form Builder; they are also represented as classes in JDAPI in order to achieve the same ends programmatically.

Advantages of Using JDAPI

JDAPI offers all the advantages of the Java 2 platform and APIs for writing high-level, object-oriented programs which process Forms modules (Form Modules, Menu Modules, PL/SQL Libraries and Object Libraries). Java is increasing in popularity and JDAPI allows Java developers to apply their knowledge and the standard Java APIs to Forms programming.
In addition there are some utility features and constructs not available elsewhere. For example, it is possible to construct Forms objects directly on Object Library Tabs, and thus build Object Libraries without using intermediate Forms Modules, a feature not available either in the C API or the Form Builder.
Using JDAPI it is possible to create utility programs to perform actions on a large number of forms automatically. For example, you could write a servlet which takes a named Forms application and publishes information (for instance its external dependencies) about it to the web, or renders a layout preview bitmap.
Full Javadoc documentation describing the public API is available and distributed with JDAPI.

Supported Platforms with JDAPI

JDAPI is distributed with Forms as part of Oracle Developer Suite and Oracle Application Server, as well as available on any platform supported by Forms. Technically, JDAPI is part of the Forms design-time environment rather than the Forms runtime/server environment.

Comparing JDAPI to the Forms C API

JDAPI is a higher-level API than the C API and gives the user an object-oriented interface to Forms, including abstract types and interfaces, generic objects with polymorphic behavior, iterators for lists, memory management, object constructors which support subclassing, typed exceptions, and Java-style naming conventions. Forms metadata is encapsulated in a set of JDAPI metadata classes. The metadata allows powerful and generic programming to be achieved easily, for example obtaining the full set of string properties for any given object as an iterator.

沒有留言: