XSQL Sample: Update Via BC4J Action Handlers
This sample application demonstrates the use of the XSQL servlet to connect to
a BC4J middle tier project and update the database.
Content
Introduction
This sample demonstrates the usage of the BC4JUpdateViewObject action handler
to insert records into the database using the XSQL servlet.
Requirements
JDeveloper beta (build581) - These samples were created using the beta
release but they can be run on any later build.
Prerequisites
You should create a connection called hr with username/password
set to hr/hr.
You should install the BC4J Middle Tier project by unzipping this zip
file in your [JDEV_HOME]/jdev/mywork directory.
Compile it.
Running the sample
Unzip this zip file in your
[JDEV_HOME]/mywork directory.
Right click on the file called add_country.html and select Run. You
should see a simple HTML form which lets you add values to the COUNTRIES table
in the HR database. When you click SUBMIT, you will see a message saying that
the operation was successful. What happened internally was that the HTML input
was passed on to the addcountry.xsql page which transformed the data
into the BC4J canonical XML format by applying the transformation (see the
transform=country_to_canonical.xsl attribute in the action handler) stylesheet.
Summary
In this sample, you have seen how results from an HTTP POST operation can be converted
into the BC4J canonical XML format before performing the insert operation via
the UpdateViewObject Action Handler.
|