Oracle® Multimedia User's Guide 11g Release 1 (11.1) Part Number B28415-01 |
|
|
View PDF |
Oracle Multimedia includes a number of scripts and sample applications that you can use. These consist of OCI, SQL, Java, PL/SQL, and ASP/VBScript sample applications (demos). These applications are described briefly in the following sections:
The sample applications are available in the following directories after you install Oracle Multimedia:
On Linux and UNIX
<ORACLE_HOME>
/ord/img/demo
<ORACLE_HOME>
/ord/im/demo/java
<ORACLE_HOME>
/ord/http/demo/
On Windows
<ORACLE_HOME>
\ord\img\demo
<ORACLE_HOME>
\ord\im\demo\java
<ORACLE_HOME>
\ord\http\demo\
Once you have installed Oracle Multimedia, you can run the Oracle Multimedia Image OCI C sample application to modify images. Or, you can use this application as a test to confirm successful installation. The sample application files and README.txt
file are located in the Oracle home directory at:
<ORACLE_HOME>
/ord/img/demo
(on Linux and UNIX)
<ORACLE_HOME>
\ord\img\demo
(on Windows)
See the README.txt
file for more information about Oracle Multimedia image features. This section describes how to run the Oracle MultimediaImage OCI C sample application.
Running the Image OCI C Sample Application
The file imgdemo.c
is a sample application that shows how Oracle Multimedia image features can be used from within a program. The application is written in C and uses OCI, Oracle Call Interface, to access the database and use Oracle Multimedia image features.
The application operates on imgdemo.bin
, which is a bitmap (BMP) image in the demo directory. Optionally, you can supply an image file name on the command line, provided the file resides in the same directory as the application. In either case, once the image has been manipulated by Oracle Multimedia, the resulting image is written to the file imgdemo.out
and can then be viewed with common rendering tools that you supply.
When the application is run, it deletes and re-creates a table named IMGDEMOTAB
in the SCOTT
schema of the default database. This table is used to hold the application data. Once the table is created, a reference to the image file is inserted into the table. The data is then loaded into the table and converted to JFIF using the processCopy( ) method of ORDImage.
The image properties are extracted within the database using the setProperties( ) method. An UPDATE statement is issued after the setProperties( ) invocation. This is required to make the object attributes permanent because the setProperties( ) invocation has updated only a local copy of the type attributes.
Upon completion, the application leaves the imgdemo.out
file in the current directory. It also leaves the table IMGDEMOTAB
in the SCOTT
schema of the database.
Next, the process( ) method is used to cut and scale the image within the database. This is followed by an update that commits the change. The application cuts a portion of the image 100 pixels wide by 100 pixels high, starting from pixel location (100,100). This subimage is scaled to twice its original size and the resulting image is written out to the file system in a file named imgdemo.out
.
Execute the application by typing imgdemo
on the command line, as follows:
$ imgdemo <optional-image-filename>
The application displays a number of messages describing its progress, along with any errors encountered in the event that something was not set up correctly. Expect to see the following messages:
Dropping table IMGDEMOTAB... Creating and populating table IMGDEMOTAB... Loading data into cartridge... Modifying image characteristics... Writing image to file imgdemo.out... Disconnecting from database... Logged off and detached from server. Demo completed successfully.
If the application encounters any errors, it is likely that either Oracle Multimedia software has not been installed correctly, or the database has not been started. If the application completes successfully, the original image and the resulting image, which has undergone the cutting and scaling described earlier, can be viewed with common image rendering tools.
Three Java sample applications are available after installing Oracle Multimedia. These include:
Oracle Multimedia IMExample sample application
The IMExample application has been provided to help you learn to use the audio, video, image, and media (ORDDoc) client-side Java classes so you can build your own Java applications. In this Java sample application, the sample schema is used to demonstrate the use of the OrdAudio, OrdVideo, OrdImage, and OrdDoc Java objects. The sample application files and README.txt
file are located at:
<ORACLE_HOME>
/ord/im/demo/java
(on Linux and UNIX)
<ORACLE_HOME>
\ord\im\demo\java
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Chapter 5 for more information about installing and using this application.
Oracle Multimedia Java Servlet Photo Album sample application
The Java Servlet Photo Album application shows you how to use Oracle Multimedia Servlets and JSP Java API to upload and retrieve multimedia data. The sample application files and README.txt
file are located at:
<ORACLE_HOME>
/ord/http/demo/servlet
(on Linux and UNIX)
<ORACLE_HOME>
\ord\http\demo\servlet
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Section 3.2 for more information about installing and using this application.
Oracle Multimedia JavaServer Pages (JSP) Photo Album sample application
The JSP Photo Album application shows you how to use Oracle Multimedia Servlets and JSP Java API to upload and retrieve multimedia data. The sample application files and README.txt
file are located at:
<ORACLE_HOME>
/ord/http/demo/jsp
(on Linux and UNIX)
<ORACLE_HOME>
\ord\http\demo\jsp
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Section 3.3 for more information about installing and using this application.
See Oracle Application Server 10g Multimedia Tag Library for JSP User's Guide and Reference in the Oracle Application Server Online Documentation Library for information about using Multimedia Tag Library.
Two PL/SQL sample applications are available after installing Oracle Multimedia. These include:
Oracle Multimedia PL/SQL Web Toolkit Photo Album sample application
The PL/SQL Web Toolkit Photo Album application shows how to upload and retrieve image data using the PL/SQL Web Toolkit and PL/SQL Gateway. The SQL scripts and README.txt
file are located at:
<ORACLE_HOME>
/ord/http/demo/plsqlwtk
(on Linux and UNIX)
<ORACLE_HOME>
\ord\http\demo\plsqlwtk
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Section 3.1 for more information about installing and using this application.
Oracle Multimedia Code Wizard sample application for the PL/SQL Gateway
The Code Wizard application for the PL/SQL Gateway is an example of a tool that lets you create PL/SQL procedures for the PL/SQL Gateway to upload and retrieve media data stored in the database using any of the Oracle Multimedia object types. The SQL scripts and README.txt
file are located at:
<ORACLE_HOME>
/ord/http/demo/plsgwycw
(on Linux and UNIX)
<ORACLE_HOME>
\ord\http\demo\plsgwycw
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Chapter 4 for more information about installing and using this application.
Oracle Multimedia also provides the Oracle Multimedia ASP/VBScript Photo Album sample application, which shows how to upload and retrieve multimedia data using Microsoft Active Server Pages (ASP) and Visual Basic Scripting (VBScript). The sample application files and README.txt
file are located at:
<ORACLE_HOME>
/ord/http/demo/asp
(on Linux and UNIX)
<ORACLE_HOME>
\ord\http\demo\asp
(on Windows)
See the README.txt
file for requirements and instructions on how to run this sample application. See Section 3.4 for more information about installing and using this application.
Additional Oracle Multimedia sample applications are available from the Oracle Multimedia Web page on the Oracle Technology Network at
http://www.oracle.com/technology/sample_code/products/intermedia/