XSQL Sample: Selective Query Application
This sample application demonstrates the use of the XSQL servlet to connect
to a BC4J middle tier project and query and update the database. It also
shows you how you can apply different stylesheets to the same document
and view the results on an HTML browser or a cell phone simulator.
Content
Introduction
This sample demonstrates the usage of the <where> element to
query records selectively 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 countries.xsql and select Run.
You should see a list of all the countries in the HR database. You should
then be able to query information about a specific country by passing a
parameter in the URL. There is an example of this in the README.html file
which is also in the XSQLClient.jpr project.
You can then test the effect of using XSLT transformation to convert
the raw XML data to an HTML tabular format by uncommenting the following
line at the top of the countries.xsql page.
<?xml-stylesheet type="text/xsl" href="htmlformat.xsl"
?>
Summary
Querying selectively is possible using the XSQL pages framework. You can
specify multiple attributes to limit the results of your query by specifying
then in the <where> element. For more information about the <where>
element,
check out the following section of the documentation.
|