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 ORDAudio:
Methods invoked at the ORDAudio 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 ORDAudio object type, which supports the storage and management of audio data.
The ORDAudio object type supports the storage and management of audio 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 ORDAudio extends ORDMultiMedia { String encoding; int numberOfChannels; int samplingRate; int sampleSize; String compressionType; int audioDuration; String description; CLOB comments; public ORDAudio( ) { } public ORDAudio(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 setEncoding(String the_encoding) { } public void setNumberOfChannels(int the_numberOfChannels) { } public void setSamplingRate(int the_samplingRate) { } public void setSampleSize(int the_sampleSize) { } public void setCompressionType(String the_compressionType) { } public void setKnownAttributes(String knownFormat, String knownEncoding, int knownNumberOfChannels, int knownSampleSize, int knownSamplingRate, String knownCompressionType, int knownAudioDuration) { } public void setAudioDuration(int the_audioDuration) { } public String getFormat(byte[ ] ctx) throws SQLException { } public String getEncoding(byte[ ] ctx) throws SQLException { } public String getEncoding( ) { } public int getNumberOfChannels(byte[ ] ctx) throws SQLException { } public int getNumberOfChannels( ) { } public int getSamplingRate(byte[ ] ctx) throws SQLException { } public int getSamplingRate( ) { } public int getSampleSize(byte[ ] ctx) throws SQLException { } public int getSampleSize( ) { } public String getCompressionType(byte[ ] ctx) throws SQLException { } public String getCompressionType( ) { } public int getAudioDuration(byte[ ] ctx) throws SQLException { } public int getAudioDuration( ) { } public void setDescription(String the_description) { } public String getDescription( ) { } 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 { } 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[ ] processAudioCommand(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:
This section presents ORDAudio reference information on the methods used for audio data manipulation. These methods are described in the following groupings:
This section presents reference information on the ORDAudio methods associated with audio attribute accessors.
The methods described in this reference chapter show examples based on the instantiation of an ORDAudio object. For the examples in Section 5.2.1 through Section 5.2.11, please consult the following code:
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 setEncoding(String the_encoding)
public
Sets the encoding in the client-side ORDAudio object.
The encoding value to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setEncoding("MULAW");
where:
public String getEncoding(byte[ ] ctx) throws SQLException
public
Gets the encoding from the server-side ORDAudio object by calling the server-side method getEncoding(ctx RAW), which extracts the information from the BLOB data.
The format plug-in context information.
This method returns the encoding.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . String audStr = audioObj.getEncoding(ctx); } catch(SQLException e){ . . . }
where:
public String getEncoding( )
public
Gets the encoding from the client-side ORDAudio object from the client cache.
None.
This method returns the encoding value present in the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . String audStr = audioObj.getEncoding( );
public void setNumberOfChannels(int the_numberOfChannels)
public
Sets the number of channels in the client-side ORDAudio object.
The number of channels value to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setNumberOfChannels(1);
where:
public int getNumberOfChannels(byte[ ] ctx) throws SQLException
public
Gets the number of channels in the server-side ORDAudio object by calling the server-side method getNumberOfChannels(ctx RAW), which extracts the number of channels from the BLOB data.
The format plug-in context information.
This method returns the number of channels.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.getNumberOfChannels(ctx); } catch(SQLException e){ . . . }
where:
public int getNumberOfChannels( )
public
Returns the number of channels in the client-side ORDAudio object from the client cache.
None.
This method returns the number of channels present in the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getNumberOfChannels( );
public void setSamplingRate(int the_samplingRate)
public
Sets the sampling rate in the client-side ORDAudio object.
The sampling rate to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setSamplingRate(10);
where:
public int getSamplingRate(byte[ ] ctx) throws SQLException
public
Gets the sampling rate of the server-side ORDAudio object. The method gets the sampling rate by calling the server-side method getSamplingRate(ctx RAW), which extracts the sampling rate from the BLOB data.
The format plug-in context information.
This method returns the sampling rate.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.getSamplingRate(ctx); } catch(SQLException e){ . . . }
where:
public int getSamplingRate( )
public
Gets the sampling rate of the client-side ORDAudio object from the client cache.
None.
This method returns the sampling rate value in the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getSamplingRate( );
public void setSampleSize(int the_sampleSize)
public
Sets the sample size of the client-side ORDAudio object.
The sample size to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setSampleSize(100);
where:
public int getSampleSize(byte[ ] ctx) throws SQLException
public
Gets the sample size of the server-side ORDAudio object. The method gets the sample size by calling the server-side method getSampleSize(ctx RAW), which extracts the sample size from the BLOB data.
The format plug-in context information.
This method returns the sample size.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.getSampleSize(ctx); } catch(SQLException e){ . . . }
where:
public int getSampleSize( )
public
Gets the sample size of the client-side ORDAudio object from the client cache.
None.
This method returns the sample size value from the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getSampleSize( );
public void setCompressionType(String the_compressionType)
public
Sets the compression type of the client-side ORDAudio object.
The compression type to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setCompressionType("8BITMONOAUDIO");
where:
public String getCompressionType(byte[ ] ctx) throws SQLException
public
Gets the compression type of the server-side ORDAudio object. The method gets the compression type by calling 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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . String audStr = audioObj.getCompressionType(ctx); } catch(SQLException e){ . . . }
where:
public String getCompressionType( )
public
Gets the compression type of the client-side ORDAudio object from the client cache.
None.
This method returns the compression type stored in the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . String audStr = audioObj.getCompressionType( );
public void setAudioDuration(int the_audioDuration)
public
Sets the audio duration in the client-side ORDAudio object.
The audio duration to be set.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setAudioDuration(100);
where:
public int getAudioDuration(byte[ ] ctx) throws SQLException
public
Gets the audio duration of the server-side ORDAudio object. The method gets the audio duration by calling the server-side method getAudioDuration(ctx RAW), which extracts the audio duration from the BLOB data.
The format plug-in context information.
This method returns the audio duration.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.getAudioDuration(ctx); } catch(SQLException e){ . . . }
where:
public int getAudioDuration( )
public
Gets the audio duration of the client-side ORDAudio object from the client cache.
None.
This method returns the audio duration value stored in the client object cache.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getAudioDuration( );
public String getFormat(byte[ ] ctx) throws SQLException
public
Gets the format in the server-side ORDAudio object.
The format plug-in context information.
This method returns the format.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . String audStr = audioObj.getFormat(ctx); } catch(SQLException e){ . . . }
where:
public void setProperties(byte[ ] ctx) throws SQLException
public
Sets the properties of the specified audio data in both the client-side and server-side ORDAudio objects.
The audio attributes to be set include the following: format, encoding type, number of channels, sampling rate, and sample size.
The format plug-in context information.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . audioObj.setProperties(ctx); } catch(SQLException e){ . . . }
where:
public boolean checkProperties(byte[ ] ctx) throws SQLException
public
Checks whether or not the properties stored in the server-side ORDAudio object are consistent with those in the server-side raw media data.
The format plug-in context information.
This method returns true if the object cache values of the attributes match those derived from the BLOB data content; false otherwise.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . if(audioObj.checkProperties(ctx)){ system.out.println("Values matched."); } } catch(SQLException e){ . . . }
where:
public void setKnownAttributes(String knownFormat, String knownEncoding, int knownNumberOfChannels, int knownSampleSize, int knownSamplingRate, String knownCompressionType, int knownAudioDuration)
public
Sets the known attributes of the client-side ORDAudio object on the client side.
The audio data format.
The audio data encoding.
The number of channels.
The sample size.
The sampling rate.
The compression type.
The audio duration.
None.
None.
OrdAudio audioObj = new OrdAudio( ); audioObj.setKnownAttributes("AUFF", "MULAW", 1, 100, 10, "8BITMONOAUDIO", 100);
where:
public String getAttribute(byte[ ] ctx, String name) throws SQLException
public
Gets the attribute value of the server-side ORDAudio object.
The format plug-in context information.
The name of the attribute.
This method returns the attribute value.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . String audStr = audioObj.getAttribute(ctx, "encoding"); } catch(SQLException e){ . . . }
where:
public CLOB getAllAttributes(byte[ ] ctx) throws SQLException
public
Gets all the attributes values of the server-side ORDAudio object and returns them as a CLOB.
The format plug-in context information.
This method returns all of the attribute values, as a CLOB.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . CLOB clob = audioObj.getAllAttributes(ctx); } catch(SQLException e){ . . . }
where:
public String getAllAttributesAsString(byte[ ] ctx) throws SQLException
public
Gets all the attributes values of the server-side ORDAudio object as a String.
The format plug-in context information.
This method returns all the attribute values, as a String. It will be formatted similarly to the following String:
sample_size=8, sampling_rate=8, num_channels=1, file_format=AUFF, data_type=8BITMONOAUDIO, encoding=MULAW
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . String audStr = audioObj.getAllAttributesAsString(ctx); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDAudio methods associated with the description attribute.
See Section 5.2.1 for additional code required to run the example code.
public void setDescription(String the_description)
public
Sets the description attribute of the client-side ORDAudio object.
The description.
None.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setDescription("audio1.wav");
where:
public String getDescription( )
public
Gets the description attribute with extension of the client-side ORDAudio object.
If a lock has been acquired on the row containing the object, this method gets the title attribute locally. Otherwise, this method gets the value from the server side by refreshing the client-side object.
None.
This method returns the description.
None.
OrdAudio audioObj = new OrdAudio(connection); . . . String audStr = audioObj.getDescription( );
This section presents reference information on the ORDAudio methods associated with the comments attribute.
See Section 5.2.1 for additional code required to run the example code.
public void setComments(CLOB the_comments) throws SQLException
public
Sets the comments attribute on the server side and in the client cache with a CLOB.
The comments data.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.setComments(commentsFile); } catch(SQLException e){ . . . }
where:
public CLOB getComments( ) throws SQLException
public
Copies the CLOB from the server side to the client side and returns the LOB locator from the client cache.
None.
This method returns the comments attribute from the client cache.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . CLOB clob = audioObj.getComments( ); } catch(SQLException e){ . . . }
public String getCommentsAsString( ) throws SQLException, OutOfMemoryError
public
Returns the comments from the server-side ORDAudio object 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 ORDAudio object comments attribute.
The amount of data to be appended, in bytes.
The content to be written from the buffer.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.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 ORDAudio object comments attribute.
The offset from the beginning from which this 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{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.writeToComments(0, 5, "Drama"); } catch(SQLException e){ . . . }
where:
public String readFromComments(int offset, int amount) throws SQLException
public
Reads data from the server-side ORDAudio object comments attribute.
The offset from the beginning from which this 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{ OrdAudio audioObj = new OrdAudio(connection); . . . String audStr = audioObj.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 ORDAudio object that appears a certain number of times starting from a certain offset in the comments attribute.
The pattern to be matched.
The offset from the beginning from which this 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 attribute for the specified number of times after the offset.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.locateInComment("Drama", 0, 10); } catch(SQLException e){ . . . }
where:
public void trimComments(int newlen) throws SQLException
public
Trims the server-side ORDAudio object comments to a given length.
The new length of the comments attribute after trimming.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.trimComments(100); } catch(SQLException e){ . . . }
where:
public int eraseFromComments(int amount, int offset) throws SQLException
public
Erases data from the server-side ORDAudio object comments starting from a certain offset and continuing to a certain length.
The amount to be erased, in bytes.
The offset from the beginning from which this method will start erasing.
This method returns the amount of data erased, in bytes.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.eraseFromComments(100, 0); } catch(SQLException e){ . . . }
where:
public void deleteComments( ) throws SQLException
public
Deletes the server-side ORDAudio object comments.
None.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.deleteComments( ); } catch(SQLException e){ . . . }
public CLOB copyCommentsOut(CLOB dest, int amount, in from_loc, int to_loc) throws SQLException
public
Copies comments out from the a server-side location to a new location.
The CLOB into which the comments will be copied.
The amount of data 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{ OrdAudio audioObj = new OrdAudio(connection); . . . CLOB clob = audioObj.copyCommentsOut(my_CLOB, 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 the server-side ORDAudio object with a separate CLOB.
The location of the comments data that will be compared with the comments data of this object.
The amount of data to be compared, in bytes.
The starting position in the current object.
The starting position in the separate object.
This method returns 1 if the comments match; -1 if the comments do not match.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); OrdAudio audioObj2 = new OrdAudio(connection); . . . int i = audioObj.compareComments(audioObj2.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 to the server-side ORDAudio 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 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{ OrdAudio audioObj = new OrdAudio(connection); BFILE my_bfile; . . . audioObj.loadCommentsFromFile("commentsdir", "my_bfile", 100, 0, 99); } catch(SQLException e){ . . . }
where:
public boolean loadComments(String fileName) throws SQLException, IOException, SecurityException
public
Loads comments data to the server-side ORDAudio object from a separate 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 ORDAudio object from a separate client-side file in chunks of 32K at a time.
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 ORDAudio object comments attribute.
None.
This method returns the length of the comments attribute.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getCommentLength( ); } catch(SQLException e){ . . . }
This section presents reference information on the ORDAudio methods associated with the media type.
See Section 5.2.1 for additional code required to run the example code.
String getMediaType( )
public
Returns the media type information.
None.
This method returns the media type, which is OrdAudio.
None.
Do not use this method unless you are extending the package.
This section presents reference information on the ORDAudio methods associated with the content length.
See Section 5.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 media data in the server-side ORDAudio object.
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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.getContentLength(ctx); } catch(SQLException e){ . . . }
where
public int getContentLength( ) throws SQLException
public
Returns the content length of the media data in the server-side ORDAudio object.
None.
This method returns the content length, in bytes.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.getContentLength( ); } catch{ . . . }
This section presents reference information on the ORDAudio methods associated with communication between the client and server.
See Section 5.2.1 for additional code required to run the example code.
public void refresh(boolean forUpdate) throws SQLException
public
Copies the server-side ORDAudio object attribute values to the client-side ORDAudio object with or without locking the database row.
The indicator for whether or not the option has been refreshed for update. It is true if the object is refreshed for update; otherwise, it is false.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.refresh(false); } catch(SQLException e){ . . . }
where
public void flush( ) throws SQLException
public
Sends information from the client-side ORDAudio object to the server-side ORDAudio object.
None.
None.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); . . . audioObj.flush( ); } catch(SQLException e){ . . . }
This section presents reference information on the ORDAudio methods associated with the SQL type.
See Section 5.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 ORDAudio object.
It calls the corresponding method in the ORDMultiMedia superclass.
The indicator for whether or not the option will be updated.
The variable name of the audio 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 the values of the ORDAudio 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 audio object variable.
This method returns the SQL string that defines 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 ORDAudio object attributes.
This method is used by the refresh( ) method to declare the types of the client-side object attributes needed in order to assign values to the attributes corresponding to the 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 ORDAudio object as parameters.
This method is used by the flush( ) method to set the values of the different attributes of the server-side object with the client-side attributes.
The name of the audio object variable.
This method returns the SQL string that sets the different attributes of the audio 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 ORDAudio object.
This method is used by the flush( ) method to set the values of the different attributes of the server-side object with the client-side 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 index of the last position 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 to assign 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 starting position for getting results from the statement.
The Oracle callable statement that has been executed on the server side.
This method returns the SQL string that contains the PL/SQL DECLARE... BEGIN... END statement block.
java.sql.SQLException
Do not use this method unless you are extending the package.
This section presents reference information on the ORDAudio methods associated with generating SQL queries.
See Section 5.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 ORDAudio instance, which is used by other methods to generate SQL queries.
None.
This method returns the SQL string that is used to update an ORDAudio 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 ORDAudio methods associated with file operations.
See Section 5.2.1 for additional code required to run the example code.
public int openSource(byte[ ] userArg, byte[ ] ctx) throws SQLException
public
Opens the file source of the server-side ORDAudio object.
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{ OrdAudio audioObj = new OrdAudio(connection); . . . int i = audioObj.openSource(READONLY, ctx); } catch(SQLException e){ . . . }
where:
public int closeSource(byte[ ] ctx) throws SQLException
public
Closes the file source of the server-side ORDAudio object.
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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.closeSource(ctx); } catch(SQLException e){ . . . }
where:
public int trimSource(byte[ ] ctx, int newLen) throws SQLException
public
Trims the file source of the server-side ORDAudio object to the given length.
The source plug-in context information.
The length, in bytes, to which the file 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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . int i = audioObj.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 the server-side ORDAudio 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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . byte[ ] my_buffer; audioObj.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 ORDAudio object source, beginning at a given initial position.
The source plug-in context information.
The initial position for writing the new data in the source.
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{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . byte[ ] my_buffer; audioObj.writeToSource(ctx, 0, 100, my_buffer); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDAudio methods associated with source content operations.
See Section 5.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 local data content from the server-side ORDAudio object in the temporary BLOB.
The source plug-in context information.
The MIME type of the temporary BLOB.
The format of the temporary BLOB.
This method returns a BLOB that contains the new contents.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; . . . BLOB blob = audioObj.getContentInLob(ctx, mimeType, format); } catch(SQLException e){ . . . }
where:
This section presents reference information on the ORDAudio methods associated with processing audio data.
See Section 5.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( ) on the ORDAudio object.
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.
The result of the command execution.
This method returns the result of the command execution.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; String cmd = "compress"; String arg_list = "compression_type"; byte[ ] the_result; . . . byte[ ] result = audioObj.processSourceCommand(ctx, cmd, arg_list, the_result); } catch(SQLException e){ . . . }
where:
public byte[ ] processAudioCommand(byte[ ] ctx, String cmd, String args, byte[ ] result) throws SQLException
public
Calls the server-side processAudioCommand( ) 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.
The result of the command execution.
This method returns the result of the command execution.
java.sql.SQLException
try{ OrdAudio audioObj = new OrdAudio(connection); byte[ ] ctx = new byte[4000]; String cmd = "compress"; String arg_list = "compression_type"; byte[ ] the_result; . . . byte[ ] result = audioObj.processAudioCommand(ctx, cmd, arg_list, the_result); } catch(SQLException e){ . . . }
where: