Oracle Visual Information Retrieval Java Classes User's Guide and Reference
Release 8.1.7

Part Number A85333-01

Library

Product

Contents

Index

Go to previous page Go to next page

1
Introduction

Oracle8i Visual Information Retrieval is an extension to Oracle8i that provides image storage, content-based retrieval, and format conversion capabilities through an object type. The capabilities of this product encompass the storage, retrieval, and manipulation of image data managed by the Oracle8i database server. This product supports image storage using binary large objects (BLOBs) and references to image data residing externally in binary files (BFILEs) or URLs.

Visual Information Retrieval is a building block for various imaging applications, rather than being an end-user application in itself. It consists of an object type (ORDVir) along with related methods for managing and processing image data.

Refer to Oracle Visual Information Retreival User's Guide and Reference for information about how visual information retrieval works.

1.1 Relationship with Oracle interMedia Image

You may already be familiar with Oracle interMedia Image, either as a component of Oracle interMedia or in a previous release as Oracle8 Image Cartridge. The base interMedia Image option and Visual Information Retrieval both let you store an image as an object in the database or as a reference to an external file or URL. Both products let you store and query on the following attributes:

Understanding the base Image option is important because the Visual Information Retrieval object type is defined as the Image object plus a signature attribute.

The main differences between the Image option and the Visual Information Retrieval product are that Visual Information Retrieval lets you create and use indexes, and perform content-based retrieval. Content-based retrieval lets you perform queries based on intrinsic visual attributes of the image (color, structure, texture), rather than being limited to keyword searches in textual annotations or descriptions. The underlying technology was developed by Virage, Inc., a leader in content-based retrieval.

1.2 Java Application Support

Oracle Visual Information Retrieval Java Classes lets you write your own Java applications to use, retrieve, and modify multimedia data stored in an Oracle database.

Oracle Visual Information Retrieval Java Classes lets you connect to a database through JDBC calls, select a database object into a Java application object, perform various operations on the application object, and commit your changes to the database object.

1.3 Interaction Between the Database and Java Application

Perform the following operations to make a connection between a database object and an application object:

  1. Make a connection from the application to the database through JDBC calls.

    Write a method that returns a valid OracleConnection object; see Example 2-3 for an example of a method that makes a connection to the database.

  2. Execute a SELECT statement on the database table and store the results in your application.

    To execute the SELECT statement, you must create a Statement object in your application, use the executeQuery( ) method to execute the SELECT statement, and cast the results into an OracleResultSet object. See steps 1 and 2 of Example 2-4 for an example.

  3. Move the results into an ORDVir object with the getCustomDatum( ) method.

    Create an application ORDVir object, and instantiate it with the results of the getCustomDatum( ) method. See step 5 of Example 2-4 for an example.

    You should now have an application ORDVir object that is identical to the database object.

  4. Perform operations on the application object.

  5. Update the database object to include the results of the operations in step 4.

    Create an OraclePreparedStatement object that contains a SQL statement that updates the database object, and execute the statement. See step 8 of Example 2-4 for an example.

  6. Commit your changes.

    Unless you used the setAutoCommit( ) method to true in your connection method, you must perform an explicit commit to update the database object with any changes that you made to the application object. You do this with the JDBC commit( ) method. See step 4 of Example 2-2 for an example of the commit( ) method.

  7. Close the connection.

    Close the connection between the application and database with the JDBC close( ) method. See step 5 of Example 2-2 for an example of the close( ) method.

    For more information about using JDBC, see Oracle8i JDBC Developer's Guide and Reference.

1.4 Compatibility with Previous Versions of Visual Information Retrieval

Oracle Corporation may evolve the Visual Information Retrieval object type by adding new object attributes in a future release. If you want client-side applications to maintain compatibility to release 8.1.7 of the ORDVir object type, even after a server upgrade that evolves the object types, you are advised to make a call to the compatibility initialization function at the beginning of the application.


Note:

If you do not follow the recommended actions, you may have to upgrade, and perhaps even recompile, your application when you upgrade to a newer release of the server that evolves the ORDVir types. 


Client-side applications written in Java using the Visual Information Retrieval Java Classes for release 8.1.7 should call the OrdMediaUtil.virCompatibilityInit( ) function after connecting to Oracle.

public static void virCompatibilityInit(OracleConnection con)
    throws Exception

This Java function takes an OracleConnection object as an argument. The included Visual Information Retrieval 8.1.7 Java API will ensure that your 8.1.7 application will work (without upgrading) with a potential future version of Visual Information Retrieval with an evolved object type.

See Example 2-2 for an example of the virCompatibilityInit( ) method.


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index