Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle APEX Best Practices

You're reading from   Oracle APEX Best Practices Make the most of Oracle Apex with this guide to best practices. It will help you look at the bigger picture when building applications and take more elements into account such as security and performance.

Arrow left icon
Product type Paperback
Published in Nov 2012
Publisher Packt
ISBN-13 9781849684002
Length 298 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Oracle APEX Best Practices
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Prepare and Build 2. Leveraging the Database FREE CHAPTER 3. Printing 4. Security 5. Debugging and Troubleshooting 6. Deploy and Maintain Database Cloud Service and APEX 4.2 Index

Oracle Public Cloud


The Oracle Public Cloud is a suite of Oracle applications, middleware, and database offerings delivered in a self-service, subscription-based, elastically scalable, reliable, highly available, and secure manner.

The Oracle Public Cloud includes the following services:

  • Application Services

  • Oracle Fusion CRM Cloud Service

  • Oracle Fusion HCM Cloud Service

  • Oracle Social Network Cloud Service

Platform Services:

  • Oracle Database Cloud Service

  • Oracle Java Cloud Service

For additional information, see https://cloud.oracle.com.

The Database Cloud Service, although based on the Oracle database, is a platform as a service product rather than a database as a service product. The Database Cloud Service combines the following products:

  • Application Express

  • RESTFul web services access

  • SQL Developer

  • Packages applications

Cloud computing is a little bit misleading. For Database Cloud Service, you interact with the Oracle database.

Packaged applications

The Oracle Database Cloud Service and Application Express 4.2 include a set of business productivity applications and sample code. All of these applications are easy to use, support mobile devices, and are installable in a few clicks. Productivity applications can be unlocked for customization and learning purposes. Of course, Oracle can only provide support for locked applications. Productivity applications are not the same as sample applications, because sample applications are unlocked by default.

Examples of productivity applications are the project tracker and checklist manager. Examples of sample applications are error handling, interactive reports, and the mobile sample application.

Plan for the future

In addition to these packaged business applications and sample code, the Oracle Database Cloud Service supports third-party applications. All third-party applications will go through a validation process to ensure the safety of the application and the protection of user data in the Oracle Database Cloud Service environment (Oracle Certification).

The following screenshot shows an example of the available packaged applications:

RESTful web services

The Oracle Database Cloud Service and Application Express 4.2 include the RESTful Web Services wizard that allows you to easily create a web service to access any SQL statement or PL/SQL program. This wizard makes it easy to create RESTful web services to be used by applications outside the Database Cloud Service.

RESTful web services have three main characteristics:

  • The services use HTTP methods explicitly

  • The services are accessible through URIs

  • The services are stateless

Terminology used in the RESTful Web Services wizard are listed in the following table:

Terminology

Description

Module

The RESTful service module is used to group services.

Template

A template is identified by a unique URI, which also includes a portion based on the Database Cloud Service and the module.

Handler

A handler is based on a specific HTTP method, such as GET (select), POST (update), PUT (insert), or DELETE. You can only have one handler for each HTTP method for each template.

Source type

When you create a RESTful web service, the key attribute of the service is the source type. There are two basic categories of source types—SQL and PL/SQL.

Query

A query source type is defined as any standard SQL statement.

Query one row

The query one row source type only returns a single row from the SELECT operation.

Feed

The URL returned by the feed web service is formed by using the URI for the web service with the value for the first column in the SQL statement passed as the argument in the URI.

PL/SQL

The PL/SQL source type allows you to use any PL/SQL code to create and return data from a RESTful web service call.

The RESTful Web Services wizard

On the home page of the RESTful Web Services wizard, a report on web services modules exists. The module named oracle.example.hr is shown in the following screenshot. The home page can be reached through SQL Workshop/RESTful Web Services.

Click on the module and you will see two logical parts of the page. On the left-hand side, you will see a list of various templates within the module. On the right-hand side, you will see the attributes of this module.

The next example steps through the RESTful Web Services creation wizard are as follows:

  1. Start the wizard by clicking on Create Template, as shown in the following screenshot:

  2. Give the template a name, for example empall/.

    Note

    Remember that the forward slash at the end of the URI is required.

  3. The next step is to create the handler.

    You can do that by clicking on Create Handler just below the RESTful service (empall/):

  4. Now select the HTTP method for your RESTful service.

    The HTTP methods available here are GET (equal to select), DELETE (equal to delete), PUT (equal to insert), and POST (equal to update):

  5. From the available source types, select Query. As the output format you can choose between JSON and CSV. Select JSON.

  6. The Source field contains the source code, which will be executed when the web service is called. Enter the following query in this field:

    Select * 
    From EMP
    Order by deptno, ename
  7. Click on the Create button to save the template.

    We can test the web service by clicking on the Test button and check the outcome of the web service. An example of a possible outcome, depending on your data, is shown in the following screenshot:

    Tip

    Remark

    To have this nice layout, I installed the Firefox browser JSON viewer plug-in from https://addons.mozilla.org/en-us/firefox/addon/jsonview/.

    A report region can be created to show the output from the RESTful web services as shown in the preceding example.

Data load feature (SQL Workshop/utilities/data load)

The data load feature enables us to load or unload data from our Oracle Database Cloud Service. The utility enables you to upload data from a text file, an XML document, or a spreadsheet. This utility is accessed from the Application Express SQL Workshop.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image