Documente Academic
Documente Profesional
Documente Cultură
Objectives
After completing this lesson, you should be able to do the
following:
Start WebLogic Server
Describe the run-time environment
Describe the elements in a running form
Navigate a Forms application
Describe the two main modes of operation
Run a form in a Web browser:
Retrieve both restricted and unrestricted data
Insert, update, and delete records
Display database errors
2-2
Lesson Aim
It is helpful to understand the environment of the form operator before designing and building
your own applications. In this lesson, you run an existing application on the Web in order to
familiarize yourself with the run-time interface of Oracle Forms Builder.
Fusion Middleware
Control
Administration
Server
Metadata
repository
Managed
Server(s)
Oracle
Instance
Domain1
2-3
Domain2
Domain3
2-4
Run startManagedWebLogic.cmd or
stopManagedWebLogic.cmd (can run from the Start
menu).
Running a Form
Oracle Forms Services deployment:
Browser URL
Java applet
2-5
Running a Form
Deploying Forms applications to the Web is implemented by the three-tier architecture of Oracle
Fusion Middleware. Application logic and the Forms Runtime Engine reside on the middle tier
application server. All trigger processing occurs on database and application servers, whereas
user interface processing occurs on the Forms Client. End users can run Forms applications in a
Web browser.
Users request an application in their Web browsers by entering a URL that points to the
application. Forms Services then generates an HTML file that downloads a Java applet to the
client machine. This small applet is capable of displaying the user interface of any form, while
the application logic is executed on the middle tier.
The graphics in the slide depict a client computer at the left and a middle tier computer in the
middle, with Forms Services running. The middle tier computer communicates with the database
shown at the right of the slide. The client sends an HTTP request in the form of a URL to the
middle tier, which downloads a Java applet to the client.
http://summit.com:9001/forms/frmservlet
?form=<formname>.fmx
&userid=<username>/<password>@<database>
&buffer_records=NO&debug_messages=NO&array=YES
&query_only=NO
2-6
http
summ it.co m
9001 default for W ebLogic Server (used for testing
from Forms B uilder)
8888 default for O racle H TTP Server (more commonly
used for production)
/for ms/fr mserv let
form =cust omers .fmx
user id=<u serna me>/ <pass word>@<dat abase >
buff er_re cords =NO
debu g_mes sages =NO
... .
2-7
Web browser
URL http://summit.com:8888/forms/frmse
Forms Servlet
Forms Listener Servlet
Forms Runtime Engine
2-8
PLX files
DB
Web browser
URL http://summit.com:8888/forms/frmse
Applet started
2-9
PLX files
DB
Web browser
URL http://summit.com:8888/forms/frmse
Forms Servlet
Forms Listener Servlet
2 - 10
PLX files
DB
Forms Servlet
URL pointing to Forms Servlet
http://summit.com:8888/forms/frmservlet?form=customer
Application Server
Desktop client
Web server
formsweb.cfg
basejpi.html
URL PARAMETERS:
?form=customers.fmx
&userid=un/pw@db
&buffer_records=NO
...
Dynamic
HTML file is
created.
2 - 11
Forms Servlet
The Forms Servlet is a Java servlet that creates a dynamic HTML file by merging information
from the following sources:
The Forms Web configuration file
The Forms base HTML file
The applications URL parameters
The graphics in the slide show:
A desktop client sending a URL to the application server; the URL contains
forms/frmservlet to invoke the Forms Servlet
The Web server receiving the request and passing it to the Forms Servlet component of
Forms Services
The Forms Servlet constructing the HTML file by combining parameters from the
formsweb.cfg file, the basejpi.html file, and the parameters that are passed on the
URL
Forms Client
Desktop client
Forms client
Generic
Java applet
2 - 12
Forms Client
The Forms Client is a generic Java applet. Forms Services dynamically downloads this applet
and automatically caches it on the client machine. The Forms Client consists of a set of Java
classes. At startup, only those Java classes that are necessary to initialize the application are
downloaded. Additional class files are downloaded dynamically, as needed, to support additional
user interface activity.
You do not have to deploy a separate Java applet for each application. The same generic applet
is used to run any Forms Services application, regardless of its size and complexity.
Responsibilities of the Forms Client
The Forms Client represents the user interface layer and has three primary functions:
To render the Forms Services application display for the user
To efficiently process user interaction back to Forms Services
To process incoming messages from Forms Services and translate them into interface
objects for the end user efficiently
The slide graphics depict the Forms Client that is downloaded to the desktop client computer in
the form of a generic Java applet.
HTTP/
HTTPS
Oracle HTTP
Server or
WebLogic
Server
Forms
Listener
Servlet
2 - 13
2 - 14
1
http://pgamer-lap.us.oracle.com:8888/forms/frmservl
3
4
2
5
2 - 15
2 - 16
10
2 - 17
2 - 19
2 - 20
Retrieving Data
Unrestricted query
A B
1
2
3
4
Restricted query
A B
1
2
A B C D
1
2
3
4
2 - 21
A B C D
1
2
3
4
Retrieving Data
You can use a form module to retrieve information from the database without knowing any SQL
syntax. However, if you are an experienced SQL user, you may want to supplement Forms
default processing with your own SQL predicates. There are two general types of queries:
Query Type
Unrestricted
(global query)
Restricted
Description
The equivalent of selecting all the rows for all the represented columns
from the base table for the queried data block; depicted by the graphics
at the left of the slide
The equivalent of selecting a restricted set of rows for all the
represented columns from the base table for the queried data block;
depicted by the graphics at the right of the slide
2 - 22
Criterion
2356
%04
#BETWEEN 2350 AND
2360
CREDIT order paid
selected from pop-up list
:S
Uses
Exact match
Implied LIKE operator
BETWEEN operator
Exact match on item value (10)
Query/Where dialog box
Invoke by:
Entering
:<variable_name >
&<variable_name >
:
&
Executing query
Used to write:
Complex search
conditions
Queries with OR
predicates
The ORDER BY clause
2 - 24
Memory
Deletes
Updates
Inserts
Form module
2 - 26
Memory
Deletes
Updates
To commit or
roll back:
Menu
Inserts
or
Toolbar
2 - 28
Displaying Errors
2 - 29
Displaying Errors
If an Oracle error is displayed on the message line while you are operating a Forms application,
you can view the underlying SQL code by selecting Help > Display Error.
The screenshots in the slide show, at the top left, a forms status line showing error FRM40404: ORACLE error: unable to perform query. The bottom left screenshot
shows selecting Help > Display Error from the menu, and the screenshot at the right shows the
Database Error window that shows the SQL query statement at the top and the database error at
the bottom: ORA-01722: invalid number.
Example
The following is the SQL statement in error and its corresponding error:
SELECT order_id, order_date, order_mode, order_status,
customer_id, sales_rep_id
FROM orders
WHERE (order_id in ('a','b'))
ORA-01722: invalid number
Note: Selecting Help > Display Error displays only those errors where the error on the message
line is preceded by ORACLE error.
Summary
In this lesson, you should have learned that:
You can use WebLogic Server on the development
machine to run a Forms application in a Web browser
At run time:
The Forms Client is downloaded
The Forms Servlet creates a start HTML file
The Forms Listener Servlet starts a run-time session and
maintains communication between it and the Forms Client
The Forms Runtime Engine carries out application logic and
maintains a database connection on behalf of the Forms
Client
2 - 30
Summary
This lesson introduced the operator interface of Forms Builder. The following concepts were
covered in this lesson:
Starting WebLogic Server on the development machine
The run-time environment for Forms:
- Running a form in a browser
- Starting a run-time session: The Forms Servlet, the Forms Client, and the Forms
Listener Servlet
The data elements of a form
Summary
2 - 31
Summary (continued)
Elements of a running form
Navigation methods
Modes of operation:
- Normal mode
- Enter-Query mode
(There is also a Query mode that occurs when the form is fetching records; the
operator cannot interact with the form in Query mode.)
Retrieving data by performing:
- Restricted queries: You supply the search criteria.
- Unrestricted queries: You supply no search criteria.
Summary
2 - 32
Summary (continued)
Inserting, updating, and deleting records
Saving or clearing changes
Displaying database errors