Home > Oracle Database / Applications Tips > Oracle database administrator > Using Java for Web-deployed Forms
Oracle Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ORACLE DATABASE ADMINISTRATOR

Using Java for Web-deployed Forms


Peter Koletzke
02.20.2004
Rating: -3.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This tip is brought to you by the International Oracle Users Group (IOUG). It has been excerpted from the presentation "Top tips for Web-deployed Forms," originally presented at IOUG! Live 2003 by Peter Koletzke. Become a member of the IOUG to access a repository of technical content created for Oracle users by Oracle users.


USE JAVA

Forms runs within a Java Virtual Machine (JVM) inside a browser and offers mechanisms to tap into the JVM using custom Java code. There are a number of ways to use Java and a number of reasons that this is a compelling solution. Even if you have little or no Java language experience, you should be able to use or modify examples of Java code that are available for Forms work. In addition, Oracle's JDeveloper tool (part of the Oracle9i Developer Suite), provides a wizard and documentation to get you started developing and using Java components for Forms.

    Tip: As mentioned, the white paper Oracle9i Forms in a Java World (available in the white papers section of the OTN Forms page) provides many tips and options for using Java inside of Forms.

USE PLUGGABLE JAVA COMPONENTS

Pluggable Java Components (PJCs) are JavaBeans that are either embedded in the form as a separate object (Bean Area on the Layout Editor toolbar) or that act as a substitute for a Forms object such as an item or button. Incorporating PJCs will allow you to extend the capabilities of Forms and solve problems such as how to read and write to the client's file system, how to provide a Java spell checker for a Web form, how to implement timers that fire only on the client.

    Note: Oracle Technology Network contains examples of PJCs that you can use for file access and a Java spell checker (otn.oracle.com). The author's Web site mentioned that the end of the original paper contains an example of a timer that fires on the client side of a Web form and a file dialog that accesses client-side files.

IMPORT JAVA METHODS

You can create PL/SQL packages that call Java methods (code units) using the Java Importer (Program | Import Java Classes in the menu). This utility creates a package spec and body that can be used to call methods in a specific Java class (JavaBean or other type of class). This works similarly to the FFIGEN utility that is used to create PL/SQL wrappers that call functions in external libraries (such as Windows DLLs). This allows you to call pre-existing functionality that is written in Java or to call Web services. It also allows you to use Java to solve a complex programming problem that PL/SQL cannot handle. The Java Importer is available in Forms 6i release 2 and greater (9i). In addition, with Forms 9i, you can call code in JavaBeans directly without the PL/SQL package created by the Java Importer. The FBEAN built-in package (also documented in online help) contains procedures and functions that allow you to call the JavaBean's methods with or without arguments.

WHY USE JAVA?

Web-deployed Forms applications run on an application server and normally do not allow interaction with the client machine. PJCs allow you to write code that will execute within the client browser's Java Virtual Machine. This opens up many possibilities for integration with other applications, interaction with the client file system, performing functions that are processor-intensive outside of a common server, etc. In addition, Java offers a richer set of UI components than the Forms native toolkit so you can extend your form to do virtually anything. The Java components (Swing controls) are extendable and easily customizable.

Also, if there is a function that you cannot perform with a native Java component, you can write your own component (called a "JavaBean"). Naturally, you need to weigh the time to develop such components with the potential for reuse. You also need to consider potential performance issues that could arise from the extra program layers that Java may require. For example, creating a custom multi-record block component using the Java Swing JTable class and calling Business Components for Java will increase the functionality of the control (users can resize the columns in a JTable class). However, the additional layers required to implement this solution may slow down the Forms built with this control.

Incorporating Java into your form gives you a little experience with the Java language and its development environment without having to worry about Java deployment architectures. It also allows you to maintain and leverage your core competency in Forms technology and continue to use Forms for most requirements. As you use Java more and more in your forms, you may find that Java starts to provide a large part of the functionality and you may think about writing Java applications. Your experience with PJCs will help your transition into the Java world.

    Note: As mentioned, PJCs can provide much of the functionality of the Windows-specific strategies such as FFI and DDE. The drawback is that you need to find (or write) a replacement for the features.

IOUG: Become a member of the IOUG to access a repository of technical content created for Oracle users by Oracle users.

Rate this Tip
To rate tips, you must be a member of SearchOracle.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Oracle database administrator
Understanding SQL string functions
What is the difference between a database engineer, architect and administrator?
Import on one table from dump file
Error during RMAN backup
Can I drop a column in SYS schema?
STATSPACK tool: transaction vs. execution measurement
Should I port from Microsoft Access?
How can I find statistics on total memory usage and database connections?
Installing multiple Oracle homes
Modifying SYS password in a RAC environment

Oracle Java and J2EE
Ellison sees new opportunities for Oracle with Java on mobile devices
Oracle and Java: Some think advisory board would comfort users
Will Sun help Oracle eclipse IBM?
Unable to view Oracle tables in NetBeans
Can I make a second connection to Oracle without losing the first?
Oracle updates Microsoft developer tools
Oracle vs. SAP: The SOA factor
Impact of Oracle 9i upgrade on Java front end
Oracle updates free Web development tool
Oracle open sources TopLink at EclipseCon

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Java Data Objects  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
JDBC Connector  (SearchOracle.com)
JOLAP  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Oracle Development Solutions - SQL, J2EE, XML, SOA
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts