Oracle8i interMedia Audio, Image, and Video Java Client User's Guide and Reference
Release 8.1.5

A67296-01

Library

Product

Contents

Index

Prev Next

6
ORDImage Reference Information

Oracle8i interMedia Audio, Image, and Video Java Client contains information about the ORDImage:

6.1 Object Types

Oracle8i interMedia Audio, Image, and Video Java Client describes the ORDImage object type, which supports access to a variety of sources of image data.


ORDImage Object Type

The ORDImage object type supports the storage and management of image data.


Note:

In the following code, some methods will begin with public. This indicates that the method can be called by all classes in all packages. Methods that begin with protected are visible to all classes in the package, plus all subclasses.  


This object type is defined as follows:

package oracle.ord.media;
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
import oracle.sql.*;

public class OrdImage extends OrdMultiMedia {

     int height;
     int width;
     int contentLength;
     String contentFormat;
     String compressionFormat;
     
     public OrdImage( ) 
     { } 
     
     public OrdImage(Connection connection)
     { }
     
     String getMediaType( )
     { }
     
     String getFormatStr( )
     { }
     
     String getUpdStr( )
     { }
     
     String getSourceStr( )
     { }
     
     String getContentLengthAPI( )
     { }
     
     int bindInSQLParams(int start, OracleCallableStatement stmt)
     throws SQLException
     { }
     
     String defineSQLResults(String var)
     { }
     
     int declareSQLResults(int start, OracleCallableStatement stmt)
     throws SQLException
     { }
     
     String setSQLParams(String var)
     { }
     
     int getSQLResults(int start, OracleCallableStatement stmt)
     throws SQLException
     { }
     
     public void refresh(boolean forUpdate)
     throws SQLException
     { }
     
     public void flush( )
     throws SQLException
     { }
     
     public void copy(OrdImage dest)
     throws SQLException
     { }
     
     public void setProperties( )
     throws SQLException
     { }
     
     public void setProperties(String description)
     throws SQLException
     { }
     
     public boolean checkProperties( )
     throws SQLException
     { }
     
     public int getHeight( )
     throws SQLException
     { }
     
     public int getContentLength( )
     throws SQLException
     { }
     
     public int getWidth( )
     throws SQLException
     { }
     
     public String getContentFormat( )
     throws SQLException
     { }
     
     public String getCompressionFormat( )
     throws SQLException
     { }
     
     public String getAllAttributesAsString( )
     throws Exception
     { }
     
     public void process(String cmd)
     throws SQLException
     { }
     
     public void processCopy(String cmd, OrdImage dest)
     throws SQLException
     { }
}

where the class attributes are defined as:

6.2 Methods

This section presents ORDImage reference information on the methods used for image data manipulation. These methods are described in the following groupings:

ORDImage Methods Associated with Image Attribute Accessors

ORDImage Methods Associated with the Media Type

ORDImage Methods Associated with Communication Between the Client and Server

ORDImage Methods Associated with the SQL Type

ORDimage Methods Associated with Generating SQL Queries

ORDImage Methods Associated with properties Operations

ORDImage Methods Associated with Copy Operations

ORDImage Methods Associated with Processing Image Data

6.2.1 ORDImage Methods Associated with Image Attribute Accessors

This section presents reference information on the ORDImage methods associated with the height attribute.

The methods described in this reference chapter show examples based on the instantiation of an ORDImage object. For the examples in Section 6.2.1 through Section 6.2.8, please consult the following Java code:

import oracle.ord.media.mediaClass;

public class clientProgram {
     public static void main(String[ ] args){
          The code in the examples appears here
     }
}

In each example, the parameter connection is a connection to the Oracle database.


getHeight( ) Method

Format

public int getHeight( )
throws SQLException

Scope

public

Description

Gets the image height of the client-side ORDImage object attribute from the client cache.

Parameter

None.

Returns

This method returns the height.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     int i = imageObj.getHeight( );
}
catch(SQLException e){
     .
     .
     .
}

getWidth( ) Method

Format

public int getWidth( )
throws SQLException

Scope

public

Description

Gets the image width attribute of the client-side ORDImage object attribute from the client cache.

Parameter

None.

Returns

This method returns the width.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     int i = imageObj.getWidth( );
}
catch(SQLException e){
     .
     .
     .
}

getContentLength( ) Method

Format

public int getContentLength( )
throws SQLException

Scope

public

Description

Gets the length attribute of the client-side ORDImage object attribute from the client cache.

Parameter

None.

Returns

This method returns the content length.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     int i = imageObj.getContentLength( );
}
catch(SQLException e){
     .
     .
     .
}

getContentFormat Method

Format

public String getContentFormat( )
throws SQLException

Scope

public

Description

Gets the image content format attribute of the client-side ORDImage object attribute from the client cache.

Parameter

None.

Returns

This method returns the content format.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     String imgStr = imageObj.getContentFormat( );
}
catch(SQLException e){
     .
     .
     .
}

getCompressionFormat( ) Method

Format

public String getCompressionFormat( )
throws SQLException

Scope

public

Description

Gets the compression format attribute of the client-side ORDImage object attribute from the client cache.

Parameter

None.

Returns

This method returns the compression format.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     String imgStr = imageObj.getCompressionFormat( );
}
catch(SQLException e){
     .
     .
     .
}

getAllAttributesAsString( ) Method

Format

public String getAllAttributesAsString( )
throws Exception

Scope

public

Description

Gets all the image attributes of the client-side ORDImage object attribute and returns them as a String.

Parameter

None.

Returns

This method returns all the ORDImage attributes.

Exceptions

java.lang.Exception

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     String imgStr = imageObj.getAllAttributesAsString( );
}
catch(Exception e){
     .
     .
     .
}

6.2.2 ORDImage Methods Associated with the Media Type

This section presents reference information on the ORDImage methods associated with the media type.

See Section 6.2.1 for additional code required to run the example code.


getMediaType( ) Method

Format

package String getMediaType( )

Scope

package

Description

Returns the media type information.

Parameter

None.

Returns

This method returns the media type, which is OrdImage.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.

6.2.3 ORDImage Methods Associated with Communication Between the Client and Server

This section presents reference information on the ORDImage methods associated with the communication between the client and server.

See Section 6.2.1 for additional code required to run the example code.


refresh( ) Method

Format

public void refresh(boolean forUpdate)
throws SQLException

Scope

public

Description

Sends information from the server-side ORDImage object to the client-side ORDImage object with or without locking the database row.

Parameter

forUpdate

The indicator for whether or not the option is selected for update. It is set to true if it is selected for update; false otherwise.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     imageObj.refresh(false);
}
catch(SQLException e){
     .
     .
     .
}

where


flush( ) Method

Format

public void flush( )
throws SQLException

Scope

public

Description

Sends information from the client-side ORDImage object to the server-side ORDImage object.

Parameter

None.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     imageObj.flush( );
}
catch(SQLException e){
     .
     .
     .
}

6.2.4 ORDImage Methods Associated with the SQL Type

This section presents reference information on the ORDImage methods associated with the SQL type.

See Section 6.2.1 for additional code required to run the example code.


bindInSQLParams Method

Format

int bindInSQLParams(int start, OracleCallableStatement stmt)
throws SQLException

Scope

package

Description

Binds the local values of the ORDImage object attributes to the parameters of the given statement.

Parameters

start

The initial position of the binding parameter index.

stmt

The Oracle callable statement to which the values will be bound.

Returns

This method returns an integer containing the next position to be bound.

Exceptions

java.sql.SQLException

Usage

Do not use this method unless you are extending the package.


defineSQLResults( ) Method

Format

String defineSQLResults(String var)

Scope

package

Description

Constructs a SQL statement to transfer data from a fetched object to the local object attributes.

Parameter

var

The name of the image object variable to be used in the PL/SQL block.

Returns

This method returns the SQL assignments from the fetched object to the binding attributes.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.


declareSQLResults( ) Method

Format

int declareSQLResults(int start, OracleCallableStatement stmt)
throws SQLException

Scope

package

Description

Binds the output parameters in a statement produced by the defineSQLResults( ) method to the attributes of the ORDImage object.

Parameters

start

The initial position of the binding parameter index.

stmt

The Oracle callable statement to which the parameters will be bound.

Returns

This method returns an integer value indicating the next binding position.

Exceptions

java.sql.SQLException

Usage

Do not use this method unless you are extending the package.


setSQLParams( ) Method

Format

String setSQLParams(String var)

Scope

package

Description

Constructs a SQL statement to set the attributes of a database ORDImage object to the values specified by the binding parameters.

Parameter

var

The name of the image object variable in the PL/SQL block.

Returns

This method returns the SQL assignments from the binding parameters to the database object attributes.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.


getSQLResults( ) Method

Format

int getSQLResults(int start, OracleCallableStatement stmt)
throws SQLException

Scope

package

Description

Updates the attributes of the client-side ORDImage object with values from the database object fetched by the executing statement.

Parameters

start

The initial position of the binding index.

stmt

The Oracle callable statement that will fetch the values from the database object.

Returns

This method returns an integer value indicating the next binding position for the statement.

Exceptions

java.sql.SQLException

Usage

Do not use this method unless you are extending the package.

6.2.5 ORDImage Methods Associated with Generating SQL Queries

This section presents reference information on the ORDImage methods associated with generating SQL queries.

See Section 6.2.1 for additional code required to run the example code.


getFormatStr( ) Method

Format

String getFormatStr( )

Scope

package

Description

Returns the format String, which is used by other methods to generate SQL queries.

Parameters

None.

Returns

This method returns the format String.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.


getUpdStr( ) Method

Format

String getUpdStr( )

Scope

package

Description

Returns the SQL string that is used to update an ORDImage instance, which is used by other methods to generate SQL queries.

Parameter

None.

Returns

This method returns the SQL string that is used to update an ORDImage instance.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.


getSourceStr( ) Method

Format

String getSourceStr( )

Scope

package

Description

Returns the source String, which is used by other methods to generate SQL queries.

Parameters

None.

Returns

This method returns the source String.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.


getContentLengthAPI( ) Method

Format

String getContentLengthAPI( )

Scope

package

Description

Returns the server-side contentLength API for this class, which is used by other methods to generate SQL queries.

Parameters

None.

Returns

This method returns the server-side contentLength API for this class.

Exceptions

None.

Usage

Do not use this method unless you are extending the package.

6.2.6 ORDImage Methods Associated with properties Operations

This section presents reference information on the ORDImage methods associated with the properties attribute.

See Section 6.2.1 for additional code required to run the example code.


setProperties( ) Method

Format

public void setProperties( )
throws SQLException

Scope

public

Description

Sets the client-side and server-side ORDImage objects attributes according to the values stored in the content data header. The local member attributes will be updated. This method sets the following attributes: height, width, data size, file type, image type, and compression type.

Parameter

None.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     imageObj.setProperties( );
}
catch(SQLException e){
     .
     .
     .
}

setProperties(String) Method

Format

public void setProperties(String description)
throws SQLException

Scope

public

Description

Sets the client-side and server-side ORDImage objects attributes according to the values provided in the parameter. This method sets the following attributes: height, width, data size, file type, image type, and compression type.

Passing an empty String for the parameter will cause a call to the server with no description parameter.

This object's member attributes will be refreshed from the database after the setProperties(String) method has been executed.

Parameter

description

The values to which the attributes will be set.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     imageObj.setProperties(null);
}
catch(SQLException e){
     .
     .
     .
}

where:


checkProperties( ) Method

Format

public boolean checkProperties( )
throws SQLException

Scope

public

Description

Checks that the properties in the server-side ORDImage object are consistent with those stored in the server-side raw media data.

Parameter

None.

Returns

This method returns true if all database object attribute values are consistent with the values in the content header; false otherwise.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     .
     .
     .
     if(imageObj.checkProperties( ))
          system.out.println("Properties are consistent.");
}
catch(SQLException e){
     .
     .
     .
}

6.2.7 ORDImage Methods Associated with Copy Operations

This section presents reference information on the ORDImage methods associated with source content operations.

See Section 6.2.1 for additional code required to run the example code.


copy( ) Method

Format

public void copy(OrdImage dest)
throws SQLException

Scope

public

Description

Copies the image data from the client-side ORDImage object source to a server-side ORDImage object.

Parameter

dest

The ORDImage that is the target of the copy operation.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     OrdImage imageObj2 = new OrdImage(connection);
     .
     .
     .
     imageObj.copy(imageObj2);
} catch(SQLException e){
     .
     .
     .
}

6.2.8 ORDImage Methods Associated with Processing Image Data

This section presents reference information on the ORDImage methods associated with processing commands to the external source.

See Section 6.2.1 for additional code required to run the example code.


process( ) Method

Format

public void process(String cmd)
throws SQLException

Scope

public

Description

Executes a given command on the server-side ORDImage object and updates the database object.

For more information on the commands that can be processed, see Oracle8i interMedia Audio, Image, and Video User's Guide and Reference.

Parameter

cmd

The command to be executed on the server side.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     String command = "FileFormat=JIFF maxScale = 32 32";
     .
     .
     .
     imageObj.process(command);
}
catch(SQLException e){
     .
     .
     .
}

where:


processCopy( ) Method

Format

public void processCopy(String cmd, OrdImage dest)
throws SQLException

Scope

public

Description

Copies image data from the server-side ORDImage object to a destination ORDImage object and modifies the copy according to the specified command.

For more information on the commands that can be processed, see Oracle8i interMedia Audio, Image, and Video User's Guide and Reference.

Parameters

cmd

The command to be executed on the server side.

dest

The ORDImage object that will receive the results of the process operation.

Returns

None.

Exceptions

java.sql.SQLException

Usage

try{
     OrdImage imageObj = new OrdImage(connection);
     OrdImage imageObj2 = new OrdImage(connection);
     String command = "contentFormat = monochrome";
     .
     .
     .
     imageObj.processCopy(command, imageObj2);
}
catch(SQLException e){
     .
     .
     .
}

where:




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index