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 ORDVideo:
Oracle8i interMedia Audio, Image, and Video Java Client contains information about the FrameDimension:
Methods invoked at the ORDVideo level that are handed off for processing to the server-side source plug-in or server-side format plug-in have byte[ ] ctx
as a context parameter. The space for the parameter is created by the client (in the reference examples, 4000 bytes of space), but the content of the context parameter is generated by the server. The context parameter is passed from the client to the server for the processing of context information.
See Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.
Oracle8i interMedia Audio, Image, and Video Java Client describes the ORDVideo object type, which supports the storage and management of video data.
The ORDVideo object type supports the storage and management of video 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 OrdVideo extends OrdMultiMedia { int width; int height; int frameResolution; int frameRate; int videoDuration; int numberOfFrames; String compressionType; int numberOfColors; int bitRate; String description; CLOB comments; public OrdVideo( ) { } public OrdVideo(Connection the_connection) { } String getMediaType( ) { } String getFormatStr( ) { } String getUpdStr( ) { } String getSourceStr( ) { } String getContentLengthAPI( ) { } public int getContentLength( ) throws SQLException { } String getSQLConstructor(boolean updateOption, String objName) { } String defineSQLResults(String var) { } int declareSQLResults(int start, OracleCallableStatement stmt) throws SQLException { } String setSQLParams(String var) { } int bindInSQLParams(int start, OracleCallableStatement stmt) throws SQLException { } int getSQLResults(int start, OracleCallableStatement stmt) throws SQLException { } public void refresh(boolean forUpdate) throws SQLException { } public void flush( ) throws SQLException { } public void setWidth(int the_width) { } public void setHeight(int the_height) { } public void setFrameResolution(int the_frameResolution) { } public void setFrameRate(int the_frameRate) { } public void setNumberOfFrames(int the_numberOfFrames) { } public void setVideoDuration(int the_videoDuration) { } public void setCompressionType(String the_compressionType) { } public void setNumberOfColors(int the_numberOfColors) { } public void setBitRate(int the_bitRate) { } public void setKnownAttributes(String knownFormat, int knownWidth, int knownHeight, int knownFrameResolution, int knownFrameRate, int knownVideoDuration, int knownNumberOfFrames, String knownCompressionType, int knownNumberOfColors, int knownBitRate) { } public String getFormat(byte[ ] ctx) throws SQLException { } public FrameDimension getFrameSize(byte[ ] ctx) throws SQLException { } public int getWidth( ) { } public int getHeight( ) { } public int getFrameResolution(byte[ ] ctx) throws SQLException { } public int getFrameResolution( ) { } public int getFrameRate(byte[ ] ctx) throws SQLException { } public int getFrameRate( ) { } public int getNumberOfFrames(byte[ ] ctx) throws SQLException { } public int getNumberOfFrames( ) { } public int getVideoDuration(byte[ ] ctx) throws SQLException { } public int getVideoDuration( ) { } public String getCompressionType(byte[ ] ctx) throws SQLException { } public String getCompressionType( ) { } public int getNumberOfColors(byte[ ] ctx) throws SQLException { } public int getNumberOfColors( ) { } public int getBitRate(byte[ ] ctx) throws SQLException { } public int getBitRate( ) { } public void setDescription(String the_description) throws SQLException { } public String getDescription( ) throws SQLException { } public int getContentLength(byte[ ] ctx) throws SQLException { } public void setProperties(byte[ ] ctx) throws SQLException { } public boolean checkProperties(byte[ ] ctx) throws SQLException { } public void appendToComments(int amount, String buffer) throws SQLException { } public void writeToComments(int offset, int amount, String buffer) throws SQLException { } public String readFromComments(int offset, int amount) throws SQLException { } public int locateInComment(String pattern, int offset, int occurrence) throws SQLException { } public void trimComments(int newlen) throws SQLException { } public int eraseFromComments(int amount, int offset) throws SQLException { } public void deleteComments( ) throws SQLException { } public CLOB copyCommentsOut(CLOB dest, int amount, int from_loc, int to_loc) throws SQLException { } public int compareComments(CLOB dest, int amount, int start_in_comment, int start_in_compare_comment) throws SQLException { } public void loadCommentsFromFile(String loc, String fileName, int amount, int from_loc, int to_loc) throws SQLException { } public int getCommentLength( ) throws SQLException { } public String getAttribute(byte[ ] ctx, String name) throws SQLException { } public CLOB getAllAttributes(byte[ ] ctx) throws SQLException { } public String getAllAttributesAsString(byte[ ] ctx) throws SQLException { } public BLOB getContentInLob(byte[ ] ctx, StringBuffer mimeType, StringBuffer format) throws SQLException { } public int openSource (byte[ ] userArg, byte[ ] ctx) throws SQLException { } public int closeSource (byte[ ] ctx) throws SQLException { } public int trimSource (byte[ ] ctx, int newLen) throws SQLException { } public int readFromSource(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException { } public int writeToSource(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException { } public byte[ ] processSourceCommand(byte[ ] ctx, String cmd, String args, byte[ ] result) throws SQLException { } public byte[ ] processVideoCommand(byte[ ] ctx, String cmd, String args, byte[ ] result) throws SQLException { } public CLOB getComments( ) throws SQLException { } public void setComments(CLOB the_comments) throws SQLException { } public String getCommentsAsString( ) throws SQLException, OutOfMemoryError { } public boolean loadComments(String filename) throws SQLException, IOException, SecurityException { } boolean loadCommentsInChunks(String fileName, int fileLength) throws SQLException, IOException { } }
where the class attributes are defined as:
The FrameDimension object type defines the FrameDimension object, which is used to store video width and height information.
Note: In the following code, the methods begin with public. This indicates that the method can be called by all classes in all packages. |
This object type is defined as follows:
package oracle.ord.media; public class FrameDimension { int width; int height; /** * Constructor */ public FrameDimension( ) { } public int getWidth( ) { } public int getHeight( ) { } public void setWidth(int the_width) { } public void setHeight(int the_height) { } }
where the class attributes are defined as:
This section presents ORDVideo reference information on the methods used for video data manipulation. These methods are described in the following groupings:
This section presents reference information on the ORDVideo methods associated with video attribute accessors.
The methods described in this reference chapter show examples based on the instantiation of an ORDVideo object. For the examples in Section 7.2.1 through Section 7.2.11, please consult the following Java code:
import oracle.ord.media.*; 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 void setWidth(int the_width)
public
Sets the width of the client-side ORDVideo object.
The width value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setWidth(300);
where:
public void setHeight(int the_height)
public
Sets the height of the client-side ORDVideo object.
The height value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setHeight(300);
where:
public FrameDimension getFrameSize(byte[ ] ctx) throws SQLException
public
Gets the frame width and height of the server-side ORDVideo object.
This method calls the server-side method getFrameSize(ctx RAW), which extracts the frame width and height information from the BLOB data.
The format plug-in context information.
This method returns the frame size. For more information on the FrameDimension class, see "FrameDimension Object Type" and Section 7.3.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . Frame Dimension frameSpecs = videoObj.getFrameSize(ctx); } catch(SQLException e){ . . . }
where:
public int getWidth( )
public
Gets the width of the client-side ORDVideo object from the client cache.
None.
This method returns the width value from the object attribute in the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getWidth( );
public int getHeight( )
public
Gets the height of the client-side ORDVideo object from the client cache.
None.
This method returns the height value from the object attribute in the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getHeight( );
public void setFrameResolution(int the_frameResolution)
public
Sets the frame resolution of the client-side ORDVideo object.
The frame resolution value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setFrameResolution(4);
where:
public int getFrameResolution(byte[ ] ctx) throws SQLException
public
Gets the frame resolution of the server-side ORDVideo object.
This method calls the server-side method getFrameResolution(ctx RAW), which extracts the frame resolution from the BLOB data.
The format plug-in context information.
This method returns the frame resolution.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getFrameResolution(ctx); } catch(SQLException e){ . . . }
where:
public int getFrameResolution( )
public
Gets the frame resolution of the client-side ORDVideo object from the client cache.
None.
This method returns the frame resolution from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getFrameResolution( );
public void setFrameRate(int the_frameRate)
public
Sets the frame rate of the client-side ORDVideo object.
The frame rate value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setFrameRate(5);
where:
public int getFrameRate(byte[ ] ctx) throws SQLException
public
Gets the frame rate of the server-side ORDVideo object.
This method calls the server-side method getFrameRate(ctx RAW), which extracts the frame rate from the BLOB data.
The format plug-in context information.
This method returns the frame rate.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getFrameRate(ctx); } catch(SQLException e){ . . . }
where:
public int getFrameRate( )
public
Gets the frame rate of the client-side ORDVideo object from the client cache.
None.
This method returns the frame rate from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getFrameRate( );
public void setVideoDuration(int the_videoDuration)
public
Sets the video duration of the client-side ORDVideo object.
The value of the video duration to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setVideoDuration(500);
where:
public int getVideoDuration(byte[ ] ctx) throws SQLException
public
Gets the video duration of the server-side ORDVideo object.
This method calls the server-side method getVideoDuration(ctx RAW), which extracts the video duration from the BLOB data.
The format plug-in context information.
This method returns the video duration.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getVideoDuration(ctx); } catch (SQLException e){ . . . }
where:
public int getVideoDuration
public
Gets the video duration of the client-side ORDVideo object from the client cache.
None.
This method returns the video duration from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getVideoDuration( );
public void setNumberOfFrames(int the_numberOfFrames)
public
Sets the number of frames in the client-side ORDVideo object.
The value of the number of frames to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setNumberOfFrames(2000);
where:
public int getNumberOfFrames(byte[ ] ctx) throws SQLException
public
Gets the number of frames in the server-side ORDVideo object.
This method calls the server-side method getNumberOfFrames(ctx RAW), which extracts the number of frames from the BLOB data.
The format plug-in context information.
This method returns the number of frames.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getNumberOfFrames(ctx); } catch(SQLException e){ . . . }
where:
public int getNumberOfFrames( )
public
Gets the number of frames in the client-side ORDVideo object from the client cache.
None.
This method returns the number of frames from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getNumberOfFrames( );
public void setCompressionType(String the_compresionType)
public
Sets the compression type of the client-side ORDVideo object.
The compression type value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setCompressionType("Cinepak");
where:
public String getCompressionType(byte[ ] ctx) throws SQLException
public
Gets the compression type of the server-side ORDVideo object.
This method calls the server-side method getCompressionType(ctx RAW), which extracts the compression type from the BLOB data.
The format plug-in context information.
This method returns the compression type.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . String compType = videoObj.getCompressionType(ctx); } catch(SQLException e){ . . . }
where:
public String getCompressionType( )
public
Gets the compression type of the client-side ORDVideo object from the client cache.
None.
This method returns the compression type from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . String compType = videoObj.getCompressionType( );
public void setNumberOfColors(int the_numberOfColors)
public
Sets the number of colors in the client-side ORDVideo object.
The value of the number of colors to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setNumberOfColors(4);
where:
public int getNumberOfColors(byte[ ] ctx) throws SQLException
public
Gets the number of colors in the server-side ORDVideo object.
This method calls the server-side method getNumberOfColors(ctx RAW), which extracts the number of colors from the BLOB data.
The format plug-in context information.
This method returns the number of colors.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getNumberOfColors(ctx); } catch(SQLException e){ . . . }
where:
public int getNumberOfColors( )
public
Gets the number of colors in the client-side ORDVideo object from the client cache.
None.
This method returns the number of colors from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getNumberOfColors( );
public void setBitRate(int the_bitRate)
public
Sets the bit rate in the client-side ORDVideo object.
The bit rate value to be set.
None.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setBitRate(1500);
where:
public int getBitRate(byte[ ] ctx) throws SQLException
public
Gets the bit rate in the server-side ORDVideo object.
This method calls the server-side method getBitRate(ctx RAW), which extracts the bit rate from the BLOB data.
The format plug-in context information.
This method returns the bit rate.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getBitRate(ctx); } catch(SQLException e){ . . . }
where:
public int getBitRate( )
public
Gets the bit rate in the client-side ORDVideo object from the client cache.
None.
This method returns the bit rate from the client cache.
None.
OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getBitRate( );
public String getFormat(byte[ ] ctx) throws SQLException
public
Gets the format of the server-side ORDVideo object.
This method calls the server-side method getFormat(ctx RAW), which extracts the format from the BLOB data.
The format plug-in context information.
This method returns the format.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . String vidStr = videoObj.getFormat(ctx); } catch(SQLException e){ . . . }
where:
public void setProperties(byte[ ] ctx) throws SQLException
public
Sets the properties of the specified video data in both the server-side and client-side ORDVideo objects.
The video attributes to be set include the following: format, frame size, frame resolution, frame rate, video duration, number of frames, compression type, number of colors, and bit rate.
The format plug-in context information.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . videoObj.setProperties(ctx); } catch(SQLException e){ . . . }
where:
public boolean checkProperties(byte[ ] ctx) throws SQLException
public
Checks that the properties stored in the server-side ORDVideo object are consistent with the properties stored in the server-side raw media data.
The format plug-in context information.
This method returns true if the properties stored in the object cache are the same as the properties stored in the BLOB data; false otherwise.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . if(videoObj.checkProperties(ctx)){ system.out.println("Properties are consistent."); } } catch(SQLException e){ . . . }
where:
public void setKnownAttributes(String knownFormat, int knownWidth, int knownHeight, int knownFrameResolution, int knownFrameRate, int knownVideoDuration, int knownNumberOfFrames, String knownCompressionType, int knownNumberOfColors, int knownBitRate)
public
Sets the known attributes of the client-side ORDVideo object in the client cache.
The video data format.
The width of the frame.
The height of the frame.
The frame resolution.
The frame rate.
The video duration.
The number of frames.
The compression type.
The number of colors.
The bit rate.
None.
None.
OrdVideo videoObj = new OrdVideo( ); videoObj.setKnownAttributes("MOOV", 1, 2, 4, 5, 500, 1000, "Cinepak", 256, 1500);
where:
public String getAttribute(byte[ ] ctx, String name) throws SQLException
public
Gets an attribute value of the server-side ORDVideo object.
The format plug-in context information.
The name of the attribute.
This method returns the attribute value.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . String vidStr = videoObj.getAttribute(ctx, "encoding"); } catch(SQLException e){ . . . }
where:
public CLOB getAllAttributes(byte[ ] ctx) throws SQLException
public
Gets the values of all the attributes of the server-side ORDVideo object and returns them as a CLOB.
The format plug-in context information.
This method returns all the attribute values as a CLOB.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . CLOB clob = videoObj.getAllAttributes(ctx); } catch(SQLException e){ . . . }
where:
public String getAllAttributesAsString(byte[ ] ctx) throws SQLException
public
Gets the values of all the attributes of the server-side ORDVideo object and returns them as a String.
The format plug-in context information.
This method returns all the attribute values, as a String.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . String vidStr = videoObj.getAllAttributesAsString(ctx); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDVideo methods associated with the description attribute.
See Section 7.2.1 for additional code required to run the example code.
public void setDescription(String the_description) throws SQLException
public
Sets the description attribute of the client-side ORDVideo object in the client cache.
The description.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.setDescription("video1"); } catch(SQLException e){ . . . }
where:
public String getDescription( ) throws SQLException
public
Gets the description attribute with extension of the client-side ORDVideo object from the client cache.
None.
This method returns the description.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . String desc = videoObj.getDescription( ); } catch(SQLException e){ . . . }
This section presents reference information on the ORDVideo methods associated with the comments attribute.
See Section 7.2.1 for additional code required to run the example code.
public void setComments(CLOB the_comments) throws SQLException
public
Sets the comments attribute in the client cache and on the server side with a CLOB.
The comments to be set.
None.
java.sql.SQLException.
try{ OrdVideo videoObj = new OrdVideo(connection); OrdVideo videoObj2 = new OrdVideo(connection); . . . videoObj.setComments(videoObj2.comments); } catch(SQLException e){ . . . }
where:
public CLOB getComments( ) throws SQLException
public
Copies the CLOB locator from the server-side ORDVideo object to the client-side ORDVideo object and returns the LOB locator from the client cache.
None.
This method returns the comments attribute from the client cache.
java.sql.SQLException.
try{ OrdVideo videoObj = new OrdVideo(connection); . . . CLOB clob = videoObj.getComments( ); } catch(SQLException e){ . . . }
public String getCommentsAsString( ) throws SQLException, OutOfMemoryError
public
Returns the server-side ORDVideo object comments as a String.
None.
This method returns the comments attribute as a String.
java.sql.SQLException
java.lang.OutOfMemoryError
try{ OrdAudio audioObj = new OrdAudio(connection); . . . String comments = audioObj.getCommentsAsString( ); } catch(SQLException e){ . . . }
public void appendToComments(int amount, String buffer) throws SQLException
public
Appends data to the server-side ORDVideo object comments attribute.
The amount of data to be appended, in bytes.
The content to be appended from the buffer.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.appendToComments(5, "Drama"); } catch(SQLException e){ . . . }
where:
public void writeToComments(int offset, int amount, String buffer) throws SQLException
public
Writes data to the server-side ORDVideo object comments attribute.
The offset from the beginning from which the method will start writing.
The amount of data to be written, in bytes.
The content to be written from the buffer.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.writeToComments(0, 5, "Drama"); } catch(SQLException e){ . . . }
where:
public String readFromComments(int offset, int amount) throws SQLException
public
Reads data from the server-side ORDVideo object comments attribute.
The offset from the beginning from which the method will start reading.
The amount of data to be read, in bytes.
This method returns the String that is read.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . String videoStr = videoObj.readFromComments(0, 5); } catch(SQLException e){ . . . }
where:
public int locateInComment(String pattern, int offset, int occurrence) throws SQLException
public
Locates a pattern in the server-side ORDVideo object that starts from a certain offset and appears a certain number of times in the comments attribute.
The pattern to be matched.
The offset from the beginning from which the method will start searching.
The number of times that the pattern should appear in the comments.
This method returns true if the pattern occurs in the comments for the specified number of times; false otherwise.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.locateInComment("Drama", 0, 10); } catch(SQLException e){ . . . }
where:
public void trimComments(int newlen) throws SQLException
public
Trims the server-side ORDVideo object comments to a given length.
The new length of the comments.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.trimComments(100); } catch(SQLException e){ . . . }
where:
public int eraseFromComments(int amount, int offset) throws SQLException
public
Erases a given amount of data from the server-side ORDVideo object comments starting from a given position.
The amount to be erased, in bytes.
The offset from the beginning from which the method will start erasing.
The amount of data erased, in bytes.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.eraseFromComments(100, 0); } catch(SQLException e){ . . . }
where:
public void deleteComments( ) throws SQLException
public
Deletes the server-side ORDVideo object comments.
None.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.deleteComments( ); } catch(SQLException e){ . . . }
public CLOB copyCommentsOut(CLOB dest, int amount, int from_loc, int to_loc) throws SQLException
public
Copies the comments out from a server-side location to a separate location.
The new location to which the data will be copied.
The amount to be copied, in bytes.
The position where the copying will begin.
The position where the copying will end.
This method returns the CLOB into which the comments are copied.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); OrdVideo videoObj2 = new OrdVideo(connection); . . . CLOB clob = videoObj.copyCommentsOut(videoObj2.comments, 100, 0, 99); } catch(SQLException e){ . . . }
where:
public int compareComments(CLOB dest, int amount, int start_in_comment, int start_in_compare_comment) throws SQLException
public
Compares the comments of a server-side ORDVideo object with the comments of a separate CLOB.
The location of the comments data that will be compared with the comments data of the current object.
The amount of data to be compared, in bytes.
The starting position in the current object.
The starting position in the destination object.
This method returns 1 if there is a positive match; -1 otherwise.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); OrdVideo videoObj2 = new OrdVideo(connection); . . . int i = videoObj.compareComments(videoObj2.comments, 100, 0, 50); } catch(SQLException e){ . . . }
where:
public void loadCommentsFromFile(String loc, String fileName, int amount, int from_loc, int to_loc) throws SQLException
public
Loads a given amount of comments data from the server-side ORDVideo object from a separate server-side file.
The location of the file from which the comments will be loaded.
The name of the file from which the comments will be loaded.
The amount of comments data to be loaded, in bytes.
The start location in the comments attribute into which the comments will be loaded.
The end location in the comments attribute into which the comments will be loaded.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.loadCommentsFromFile("videodir", "jdoe.mov", 100, 0, 99); } catch(SQLException e){ . . . }
where:
public boolean loadComments(String fileName) throws SQLException, IOException, SecurityException
public
Loads comments to the server-side ORDVideo object from a client-side file.
The name of the file from which the comments will be loaded.
This method returns true upon successful loading; false otherwise.
java.sql.SQLException
java.io.IOException
java.lang.SecurityException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.loadCommentsFromFile(my_file); } catch(SQLException e){ . . . } catch(IOException io){ . . . } catch(SecurityException s){ . . . }
where:
boolean loadCommentsInChunks(String fileName, int fileLength) throws SQLException, IOException
package
Loads comments to the server-side ORDVideo object from a client-side file in chunks of 32K bytes.
The name of the file from which the comments will be loaded.
The total length of the file, in bytes.
This method returns true upon successful loading; false otherwise.
java.sql.SQLException
java.io.IOException
Do not use this method unless you are extending the package.
public int getCommentLength( ) throws SQLException
public
Gets the length of the server-side ORDVideo object comments attribute.
None.
This method returns the length of the comments attribute.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getCommentLength( ); } catch(SQLException e){ . . . }
This section presents reference information on the ORDVideo methods associated with communication between the client and server.
See Section 7.2.1 for additional code required to run the example code.
public void refresh(boolean forUpdate) throws SQLException
public
Copies the server-side ORDVideo object attribute values to the client-side ORDVideo object with or without locking the database row.
The indicator for whether or not the object will be refreshed for update.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.refresh(false); } catch(SQLException e){ . . . }
where
public void flush( ) throws SQLException
public
Copies the client-side ORDVideo object attribute values to the server-side ORDVideo object.
None.
None.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . videoObj.flush( ); } catch(SQLException e){ . . . }
This section presents reference information on the ORDVideo methods associated with the media type.
See Section 7.2.1 for additional code required to run the example code.
String getMediaType( )
package
Returns the media type information.
None.
This method returns the media type, which is OrdVideo.
None.
Do not use this method unless you are extending the package.
This section presents reference information on the ORDVideo methods associated with the content length.
See Section 7.2.1 for additional code required to run the example code.
public int getContentLength(byte[ ] ctx) throws SQLException
public
Returns the content length of the server-side ORDVideo object media data.
The source plug-in context information.
This method returns the length of the data content of the media data, in bytes.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.getContentLength(ctx); } catch(SQLException e){ . . . }
where
public int getContentLength( ) throws SQLException
public
Returns the content length of the server-side ORDVideo object media data.
None.
This method returns the content length, in bytes.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.getContentLength( ); } catch{ . . . }
This section presents reference information on the ORDVideo methods associated with the SQL type.
See Section 7.2.1 for additional code required to run the example code.
String getSQLConstructor(boolean updateOption, String objName)
package
Gets the SQL type constructor for the ORDVideo object.
This method calls the corresponding getSQLConstructor( ) method in the superclass.
The indicator for whether or not the option is flagged to be updated.
The variable name of the video object.
This method returns the SQL string that will bind an object instance variable to a database object instance.
None.
Do not use this method unless you are extending the package.
String defineSQLResults(String var)
package
Defines the SQL results that will be used to assign values to the ORDVideo object attributes.
This method is used by the refresh( ) method to assign the server-side object attribute values to the corresponding client-side object attributes.
The name of the video object variable.
This method returns the SQL string that will define the SQL results.
None.
Do not use this method unless you are extending the package.
int declareSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Declares types for the SQL results corresponding to the different ORDVideo object attributes.
This method is used by the refresh( ) method to declare the types of the client-side object attributes needed to assign values to the corresponding server-side object attributes.
The position in the statement where the binding begins.
The Oracle callable statement that will be executed on the server side.
This method returns an integer defined as position + 1, where position is the last index in the statement for which the type was declared.
java.sql.SQLException
Do not use this method unless you are extending the package.
String setSQLParams(String var)
package
Sets the values of the SQL type of the ORDVideo object as parameters.
This method is used by the flush( ) method to set the values of the different attributes of the server-side object to the same values as the attributes of the corresponding client-side object.
The name of the video object variable.
This method returns the SQL string that will set the different attributes of the video object.
None.
Do not use this method unless you are extending the package.
int bindInSQLParams(int start, OracleCallableStatement stmt) throws SQLException
package
Binds the values of the SQL type of the ORDVideo object.
This method is used by the flush( ) method to set the values of the different attributes of the server-side object to the values of the corresponding client-side object attributes.
The position in the statement where the binding begins.
The Oracle callable statement that will be executed on the server side.
This method returns an integer defined as position + 1, where position is the last index in the statement to which a value was bound.
java.sql.SQLException
Do not use this method unless you are extending the package.
int getSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Gets the SQL results in order to assign them to the attributes of the OrdMultiMedia object (for example, encoding or numberOfChannels).
This method is used by the refresh( ) method to assign the server-side object attribute values to the corresponding client-side object attributes.
The initial position for getting results from the statement.
The Oracle callable statement that has been executed on the server side.
This method returns an integer defined as position + 1, where position is the last index in the statement to which a value was bound.
java.sql.SQLException
Do not use this method unless you are extending the package.
This section presents reference information on the ORDVideo methods associated with generating SQL queries.
See Section 7.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 ORDVideo instance, which is used by other methods to generate SQL queries.
None.
This method returns the SQL string that is used to update an ORDVideo 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 ORDVideo methods associated with file operations.
See Section 7.2.1 for additional code required to run the example code.
public int openSource(byte[ ] userArg, byte[ ] ctx) throws SQLException
public
Opens the server-side ORDVideo object file source.
Permission-related parameters that are supplied by the user, such as READONLY.
The source plug-in context information.
This method returns 0 in case of success or an integer greater than 0 in case of failure.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); . . . int i = videoObj.openSource(READONLY, ctx); } catch(SQLException e){ . . . }
where:
public int closeSource(byte[ ] ctx) throws SQLException
public
Closes the server-side ORDVideo object file source.
The source plug-in context information.
This method returns 0 in case of success or an integer greater than 0 in case of failure.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.closeSource(ctx); } catch(SQLException e){ . . . }
where:
public int trimSource(byte[ ] ctx, int newLen) throws SQLException
public
Trims the server-side ORDVideo object file source to the given length.
The source plug-in context information.
The length to which the source will be trimmed.
This method returns 0 in case of success or an integer greater than 0 in case of failure.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; . . . int i = videoObj.trimSource(ctx, 100); } catch(SQLException e){ . . . }
where:
public int readFromSource(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException
public
Reads a buffer of a given number of bytes from a server-side ORDVideo object source, beginning at a given initial position.
The source plug-in context information.
The position where the method begins reading.
The amount that will be read, in bytes.
The buffer into which the data will be read.
This method returns the amount of data read, in bytes.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; byte[ ] my_buffer; . . . videoObj.readFromSource(ctx, 0, 100, my_buffer); } catch(SQLException e){ . . . }
where:
public int writeToSource(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException
public
Writes a buffer of a given number of bytes to the server-side ORDVideo object source, beginning at a given initial position.
The source plug-in context information.
The initial position where the written data will be inserted.
The number of bytes to be written.
The content to be written.
This method returns the amount of data written, in bytes.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; byte[ ] my_buffer; . . . videoObj.writeToSource(ctx, 0, 100, my_buffer); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDVideo methods associated with source content operations.
See Section 7.2.1 for additional code required to run the example code.
public BLOB getContentInLob(byte[ ] ctx, StringBuffer mimeType, StringBuffer format) throws SQLException
public
Gets the contents of the server-side ORDVideo object localData attribute and stores them in a temporary BLOB.
The source plug-in context information.
The MIME type of the temporary BLOB.
The format of the temporary BLOB.
This method returns the BLOB into which the contents have been copied.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; String mimeType = "video/mpi"; String format = "mpi"; . . . BLOB blob = videoObj.getContentInLob(ctx, mimeType, format); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDVideo methods associated with processing video data.
See Section 7.2.1 for additional code required to run the example code.
public byte[ ] processSourceCommand(byte[ ] ctx, String cmd, String args, byte[ ] result) throws SQLException
public
Calls the server-side processSourceCommand( ) method.
For more information on the commands that can be processed, see Oracle8i interMedia Audio, Image, and Video User's Guide and Reference.
The source plug-in context information.
The command that is to be executed.
The arguments for the command that is to be executed.
The result of the command that is to be executed.
This method returns the results of the command execution.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; String cmd = "compress"; String arg_list = "compression_type"; . . . byte[ ] result = videoObj.processSourceCommand(ctx, cmd, arg_list, the_result); } catch(SQLException e){ . . . }
where:
public byte[ ] processVideoCommand(byte[ ] ctx, String cmd, String args, byte[ ] result) throws SQLException
public
Calls the server-side processVideoCommand( ) method.
For more information on the commands that can be processed, see Oracle8i interMedia Audio, Image, and Video User's Guide and Reference.
The format plug-in context information.
The command that is to be executed.
The arguments for the command that is to be executed.
The result of the command that is to be executed. The memory for this variable is allocated by the client.
This method returns the results of the execution of the command.
java.sql.SQLException
try{ OrdVideo videoObj = new OrdVideo(connection); byte[ ] ctx = new byte[4000]; String cmd = "compress"; String arg_list = "compression_type"; . . . byte[ ] result = videoObj.processVideoCommand(ctx, cmd, arg_list, the_result); } catch(SQLException e){ . . . }
where:
This section presents FrameDimension reference information on the methods used for setting and returning video width and height information. These methods are described in the following groupings:
This section presents reference information on the FrameDimension methods associated with the width attribute.
public void setWidth(int the_width)
public
Sets the width in the ORDVideo object.
The width value to be set.
None.
None.
public int getWidth( )
public
Gets the width in the ORDVideo object.
None.
This method returns the width value.
None.
This section presents reference information on the FrameDimension methods associated with the height attribute.
public void setHeight(int the_height)
public
Sets the height in the ORDVideo object.
The height value to be set.
None.
None.
public int getHeight( )
public
Gets the height in the ORDVideo object.
None.
This method returns the height value.
None.