Oracle8i interMedia Audio, Image, and Video Java Client User's Guide and Reference Release 8.1.5 A67296-01 |
|
Oracle8i interMedia Audio, Image, and Video Java Client contains information about the ORDImage:
Oracle8i interMedia Audio, Image, and Video Java Client describes the ORDImage object type, which supports access to a variety of sources of image data.
The ORDImage object type supports the storage and management of image data.
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:
This section presents ORDImage reference information on the methods used for image data manipulation. These methods are described in the following groupings:
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.
public int getHeight( ) throws SQLException
public
Gets the image height of the client-side ORDImage object attribute from the client cache.
None.
This method returns the height.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . int i = imageObj.getHeight( ); } catch(SQLException e){ . . . }
public int getWidth( ) throws SQLException
public
Gets the image width attribute of the client-side ORDImage object attribute from the client cache.
None.
This method returns the width.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . int i = imageObj.getWidth( ); } catch(SQLException e){ . . . }
public int getContentLength( ) throws SQLException
public
Gets the length attribute of the client-side ORDImage object attribute from the client cache.
None.
This method returns the content length.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . int i = imageObj.getContentLength( ); } catch(SQLException e){ . . . }
public String getContentFormat( ) throws SQLException
public
Gets the image content format attribute of the client-side ORDImage object attribute from the client cache.
None.
This method returns the content format.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . String imgStr = imageObj.getContentFormat( ); } catch(SQLException e){ . . . }
public String getCompressionFormat( ) throws SQLException
public
Gets the compression format attribute of the client-side ORDImage object attribute from the client cache.
None.
This method returns the compression format.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . String imgStr = imageObj.getCompressionFormat( ); } catch(SQLException e){ . . . }
public String getAllAttributesAsString( ) throws Exception
public
Gets all the image attributes of the client-side ORDImage object attribute and returns them as a String.
None.
This method returns all the ORDImage attributes.
java.lang.Exception
try{ OrdImage imageObj = new OrdImage(connection); . . . String imgStr = imageObj.getAllAttributesAsString( ); } catch(Exception e){ . . . }
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.
package String getMediaType( )
package
Returns the media type information.
None.
This method returns the media type, which is OrdImage.
None.
Do not use this method unless you are extending the package.
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.
public void refresh(boolean forUpdate) throws SQLException
public
Sends information from the server-side ORDImage object to the client-side ORDImage object with or without locking the database row.
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.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . imageObj.refresh(false); } catch(SQLException e){ . . . }
where
public void flush( ) throws SQLException
public
Sends information from the client-side ORDImage object to the server-side ORDImage object.
None.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . imageObj.flush( ); } catch(SQLException e){ . . . }
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.
int bindInSQLParams(int start, OracleCallableStatement stmt) throws SQLException
package
Binds the local values of the ORDImage object attributes to the parameters of the given statement.
The initial position of the binding parameter index.
The Oracle callable statement to which the values will be bound.
This method returns an integer containing the next position to be bound.
java.sql.SQLException
Do not use this method unless you are extending the package.
String defineSQLResults(String var)
package
Constructs a SQL statement to transfer data from a fetched object to the local object attributes.
The name of the image object variable to be used in the PL/SQL block.
This method returns the SQL assignments from the fetched object to the binding attributes.
None.
Do not use this method unless you are extending the package.
int declareSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Binds the output parameters in a statement produced by the defineSQLResults( ) method to the attributes of the ORDImage object.
The initial position of the binding parameter index.
The Oracle callable statement to which the parameters will be bound.
This method returns an integer value indicating the next binding position.
java.sql.SQLException
Do not use this method unless you are extending the package.
String setSQLParams(String var)
package
Constructs a SQL statement to set the attributes of a database ORDImage object to the values specified by the binding parameters.
The name of the image object variable in the PL/SQL block.
This method returns the SQL assignments from the binding parameters to the database object attributes.
None.
Do not use this method unless you are extending the package.
int getSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Updates the attributes of the client-side ORDImage object with values from the database object fetched by the executing statement.
The initial position of the binding index.
The Oracle callable statement that will fetch the values from the database object.
This method returns an integer value indicating the next binding position for the statement.
java.sql.SQLException
Do not use this method unless you are extending the package.
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.
String getFormatStr( )
package
Returns the format String, which is used by other methods to generate SQL queries.
None.
This method returns the format String.
None.
Do not use this method unless you are extending the package.
String getUpdStr( )
package
Returns the SQL string that is used to update an ORDImage instance, which is used by other methods to generate SQL queries.
None.
This method returns the SQL string that is used to update an ORDImage instance.
None.
Do not use this method unless you are extending the package.
String getSourceStr( )
package
Returns the source String, which is used by other methods to generate SQL queries.
None.
This method returns the source String.
None.
Do not use this method unless you are extending the package.
String getContentLengthAPI( )
package
Returns the server-side contentLength API for this class, which is used by other methods to generate SQL queries.
None.
This method returns the server-side contentLength API for this class.
None.
Do not use this method unless you are extending the package.
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.
public void setProperties( ) throws SQLException
public
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.
None.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . imageObj.setProperties( ); } catch(SQLException e){ . . . }
public void setProperties(String description) throws SQLException
public
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.
The values to which the attributes will be set.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . imageObj.setProperties(null); } catch(SQLException e){ . . . }
where:
public boolean checkProperties( ) throws SQLException
public
Checks that the properties in the server-side ORDImage object are consistent with those stored in the server-side raw media data.
None.
This method returns true if all database object attribute values are consistent with the values in the content header; false otherwise.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); . . . if(imageObj.checkProperties( )) system.out.println("Properties are consistent."); } catch(SQLException e){ . . . }
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.
public void copy(OrdImage dest) throws SQLException
public
Copies the image data from the client-side ORDImage object source to a server-side ORDImage object.
The ORDImage that is the target of the copy operation.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); OrdImage imageObj2 = new OrdImage(connection); . . . imageObj.copy(imageObj2); } catch(SQLException e){ . . . }
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.
public void process(String cmd) throws SQLException
public
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.
The command to be executed on the server side.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); String command = "FileFormat=JIFF maxScale = 32 32"; . . . imageObj.process(command); } catch(SQLException e){ . . . }
where:
public void processCopy(String cmd, OrdImage dest) throws SQLException
public
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.
The command to be executed on the server side.
The ORDImage object that will receive the results of the process operation.
None.
java.sql.SQLException
try{ OrdImage imageObj = new OrdImage(connection); OrdImage imageObj2 = new OrdImage(connection); String command = "contentFormat = monochrome"; . . . imageObj.processCopy(command, imageObj2); } catch(SQLException e){ . . . }
where: