Oracle® interMedia User's Guide 10g Release 1 (10.1) Part Number B10840-01 |
|
|
View PDF |
Oracle interMedia includes a number of scripts and sample programs that you can use. These consist of SQL, OCI, Java, PL/SQL, and ASP/VBScript sample applications (demos).
Sample interMedia SQL, Java, and OCI applications are available in the following directories after you install interMedia:
On UNIX <ORACLE_HOME>/ord/aud/demo/ <ORACLE_HOME>/ord/doc/demo/ <ORACLE_HOME>/ord/img/demo/ <ORACLE_HOME>/ord/vid/demo/ <ORACLE_HOME>/ord/http/demo/ <ORACLE_HOME>/ord/im/demo/java.101/ On Windows <ORACLE_HOME>\ord\aud\demo\ <ORACLE_HOME>\ord\doc\demo\ <ORACLE_HOME>\ord\img\demo\ <ORACLE_HOME>\ord\vid\demo\ <ORACLE_HOME>\ord\http\demo\ <ORACLE_HOME>\ord\im\demo\java\
The audio SQL scripts consist of the following files:
auddemo.sql
- audio demo that shows features of the audio object including:
Checking interMedia objects
Creating a sample table with audio in it
Inserting NULL rows into the audio table
Selecting the rows
Checking all the audio attributes directly
Checking all the audio attributes by calling methods
Installing your own format plug-in using the two files, fplugins.sql
and fpluginb.sql
described in the next two list items and in Section 7.2.1.3 on how to extend interMedia audio features to support a new audio data format
fplugins.sql
- demo format plug-in specification that you can use as a guideline to write any audio format plug-in you want to support
fpluginb.sql
- demo format plug-in body that you can use as a guideline to write any audio format plug-in you want to support
See the README.txt
file in the <ORACLE_HOME>
/ord/aud/demo
directory on UNIX and <ORACLE_HOME>
\ord\aud\demo
directory on Windows for requirements and instructions on running this SQL demo.
See Section A.5 for a description of the Java sample application that is provided to help you learn to use the multimedia client-side Java classes so you can build your own applications.
The ORDDoc SQL scripts consist of the following files:
docdemo.sql
- ORDDoc demo that shows features of the ORDDoc object.
See the README.txt
file in the <ORACLE_HOME>
/ord/doc/demo/
directory on UNIX and <ORACLE_HOME>
\ord\doc\demo\
directory on Windows for requirements and instructions on running this SQL demo.
See Section A.5 for a description of the Java sample application that is provided to help you learn to use the multimedia client-side Java classes so you can build your own applications.
Once you have installed interMedia, you may choose to run the interMedia image OCI C program. This program can also be used as a test to confirm successful installation.
This section describes how to run the interMedia image sample program.
The interMedia image sample files are located in <ORACLE_HOME>/ord/img/demo
on UNIX and <ORACLE_HOME>\ord\img\demo
on Windows where <ORACLE_HOME> is the Oracle home directory.
For interMedia image features, see the README.txt
file at <ORACLE_HOME>/ord/img/demo
(on UNIX), and <ORACLE_HOME>\ord\img\demo
(on Windows), where <ORACLE_HOME> is the Oracle home.
The file imgdemo.c
is a sample program that shows how interMedia image features can be used from within a program. The program is written in C and uses OCI, Oracle Call Interface, to access the database and use interMedia image features.
The program operates on imgdemo.dat
, 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 program. In either case, once the image has been manipulated by interMedia, the resulting image is written to the file imgdemo.out
and can then be viewed with common rendering tools that you supply.
When the program is run, it deletes and re-creates a table named IMGDEMOTAB
in the SCOTT/TIGER
schema of the default database. This table is used to hold the program 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.
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 program 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
.
Upon completion, the program leaves the imgdemo.out
file in the current directory. It also leaves the table IMGDEMOTAB
in the SCOTT/TIGER
schema of the database.
Execute the program by typing imgdemo
on the command line.
Use the command shown in Example A-1.
Example A-1 Execute the Sample Program from the Command Line
$ imgdemo <optional-image-filename>
The program 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 program encounters any errors, it is likely that either interMedia software has not been installed correctly, or the database has not been started. If the program 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.
See Section A.5 for a description of the Java sample application that is provided to help you learn to use the multimedia client-side Java classes so you can build your own applications.
The video SQL scripts consist of the following files:
viddemo.sql
- video demo that shows features of the video object including:
Checking interMedia objects
Creating a sample table with video in it
Inserting NULL rows into the video table
Selecting the rows
Checking all the video attributes directly
Checking all the video attributes by calling methods
Installing your own format plug-in using the two files, fplugins.sql
and fpluginb.sql
described in the next two list items and in Section 7.2.3.3 on how to extend interMedia video features to support a new video data format
fplugins.sql
- demo format plug-in specification that you can use as a guideline to write any video format plug-in you want to support
fpluginb.sql
- demo format plug-in body that you can use as a guideline to write any video format plug-in you want to support
See the README.txt
file in the <ORACLE_HOME>
/ord/vid/demo
directory on UNIX and <ORACLE_HOME>
\ord\vid\demo
directory on Windows for requirements and instructions on how to run this SQL demo.
See Section A.5 for a description of the Java sample application that is provided to help you learn to use the multimedia client-side Java classes so you can build your own applications.
An IMExample Java sample 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 applications. In this sample application, the sample schema is used to demonstrate the use of the OrdAudio, OrdVideo, OrdImage, and OrdDoc Java objects.
See the README.txt
file in the <ORACLE_HOME>
/ord/im/demo/java
directory on UNIX and <ORACLE_HOME>
\ord\im\demo\java
directory on Windows for requirements and instructions on how to run this Java sample application. See Chapter 4 for a description of this Java sample application. See Oracle interMedia Java Classes Reference for information about using Oracle interMedia Java Classes.
The IMExample Java sample application files are located in:
<ORACLE_HOME>
/ord/im/demo/java
(on UNIX)
<ORACLE_HOME>
\ord\im\demo\java
(on Windows)
The interMedia Java Servlet Photo Album application shows how to use interMedia Java Classes for servlets and JSP to upload and retrieve multimedia data. See the README.txt
file at:
<ORACLE_HOME>
/ord/http/demo/servlet
(on UNIX)
<ORACLE_HOME>
\ord\http\demo\servlet
(on Windows)
The interMedia JavaServer Pages Photo Album application shows how to use interMedia Java Classes for servlets and JSP to upload and retrieve multimedia data. See the README.txt
file at:
<ORACLE_HOME>
/ord/http/demo/jsp
(on UNIX)
<ORACLE_HOME>
\ord\http\demo\jsp
(on Windows)
Two additional PL/SQL sample application packages are available after installing interMedia. These packages include:
Oracle interMedia PL/SQL Web Toolkit Photo Album application
The interMedia 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 at:
<ORACLE_HOME>
/ord/http/demo/plsqlwtk
(on UNIX)
<ORACLE_HOME>
\ord\http\demo\plsqlwtk
(on Windows)
See Section 3.1.1 for more information about installing and using this application.
Oracle interMedia Code Wizard for the PL/SQL Gateway
The interMedia Code Wizard 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 interMedia object types. The SQL scripts and README.txt
file are at:
<ORACLE_HOME>
/ord/http/demo/plsgwycw
(on UNIX)
<ORACLE_HOME>
\ord\http\demo\plsgwycw
(on Windows)
See Section 3.2 for more information about installing and using this application.
The interMedia ASP/VBScript Photo Album application illustrates how to upload and retrieve multimedia data with an ASP/VBScript application. See the README.txt
file at:
<ORACLE_HOME>
/ord/http/demo/asp
(on UNIX)
<ORACLE_HOME>
\ord\http\demo\asp
(on Windows)
See the program examples available from the interMedia Web page on the Oracle Technology Network at
http://otn.oracle.com/sample_code/products/intermedia/content.html
Sample SQL scripts that demonstrate how to set up a schema on your database are also included on the Oracle Technology Network Web site.