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 ORDSource:
Methods invoked at the ORDSource level that are handed off for processing to the server-side source 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 ORDSource object type, which supports access to a variety of sources of multimedia data.
The ORDSource object type supports access to data sources locally in a BLOB within an Oracle database, externally from a BFILE on a local file system, externally from a URL on an HTTP server, externally from streaming multimedia data on a media server, or externally from a user-defined source on another server.
Note: In the following code, the methods have the default protection, which means that they can be called only by other methods in the package. |
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 OrdSource { int MAX_CHUNKSIZE = 32300; BindToTableParams bindParams = null; String containerType; Connection connection; boolean lock = false; BLOB localData = null; String srcType; String srcLocation; String srcName; Timestamp updateTime; int local; OrdSource( ) { } void setLock(boolean lockOption) { } boolean isLocked( ) { } void setConnection(Connection the_connecton) { } Connection getConnection( ) { } String getSQLConstructor(boolean updateOption, String mmObjName, String srcObjName) { } String getUpdateStr(String mmObjName, String srcObjName) { } void flush( ) throws SQLException { } void setBindParams(BindToTableParams bParams) { } void setContainerType(String type) { } String getContainerType( ) { } 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 { } void refresh(boolean forUpdate) throws SQLException { } void setLocal( ) { } void clearLocal( ) { } boolean isLocal( ) { } Timestamp getUpdateTime( ) { } void setUpdateTime( ) throws SQLException { } void setSourceInformation(String sourceType, String sourceLocation, String sourceName) { } void setSourceType(String sourceType) { } void setSourceLocation(String sourceLocation) { } void setSourceName(String sourceName) { } String getSourceInformation( ) { } String getSourceType( ) { } String getSourceLocation( ) { } String getSourceName( ) { } BLOB importData(byte[ ] ctx, BLOB dlob, StringBuffer mimetype, StringBuffer format) throws SQLException { } BLOB importFrom(byte[ ] ctx, BLOB dlob, StringBuffer mimetype, StringBuffer format, String sourceType, String sourceLocation, String sourceName) throws SQLException { } void export(byte[ ] ctx, String sourceType, String sourceLocation, String sourceName) throws SQLException { } int getContentLength( ) throws SQLException { } String getSourceAddress( ) { } BLOB getLocalContent( ) throws SQLException { } BLOB getContentInTempLob(byte[ ] ctx, BLOB blob, StringBuffer mimetype, StringBuffer format) throws SQLException { } BLOB getContentInTempLob(byte[ ] ctx, BLOB blob, StringBuffer mimetype, StringBuffer format, int duration, boolean cache) throws SQLException { } void deleteLocalContent( ) throws SQLException { } int read(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException { } int write(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException { } int open(byte[ ] userArg, byte[ ] ctx) throws SQLException { } int close(byte[ ] ctx) throws SQLException { } int trim(byte[ ] ctx, int newLen) throws SQLException { } BFILE getBFILE( ) throws SQLException { } byte[ ] processCommand(byte[ ] ctx, String command, String argList, byte[ ] result) throws SQLException { } }
where the class attributes are defined as:
srcType | Description |
---|---|
"unknown" |
server access unknown or not provided |
"file" |
BFILE on a local file system |
"http" |
HTTP server |
"<name>" |
another server |
srcType | Name Value |
---|---|
"unknown" |
NULL or not accessed |
"file" |
<FILE> or name is the name of the file |
"http" |
<Source> or name of the object |
<name> |
<object name> or name of the object |
This section presents ORDSource reference information on the methods used for source data manipulation. These methods are described in the following groupings:
This section presents reference information on the ORDSource methods associated with the bindParams attribute.
void setBindParams(BindToTableParams bParams)
package
Sets the data location parameters.
The binding parameter values. For more information on the BindToTableParams object, see "BindToTableParams Object Type" and Section 3.3.
None.
None.
None.
This section presents reference information on the ORDSource methods associated with the containerType attribute.
void setContainerType(String type)
package
Sets the object container type to ORDAudio, ORDImage, ORDVideo, or ORDVir.
The containerType attribute indicates the type of the object in which the ORDSource object is embedded.
The value of the object type.
None.
None.
None.
String getContainerType( )
package
Gets the container type of the ORDSource object.
None.
This method returns the object type.
None.
None.
This section presents reference information on the ORDSource methods associated with the connection attribute.
void setConnection(Connection the_connection)
package
Sets the connection to the database.
The connection object.
None.
None.
None.
Connection getConnection( )
package
Gets the connection to the database.
None.
This method returns the connection.
None.
None.
This section presents reference information on the ORDSource methods associated with the lock attribute.
void setLock(boolean lockOption)
package
Sets the lock value.
A value of true means the corresponding object on the server side can be updated. A value of false means the corresponding object on the server side cannot be updated.
The lock value.
None.
None.
None.
boolean isLocked( )
package
Gets the lock value.
A value of true means the corresponding object on the server side cannot be updated. A value of false means the corresponding object on the server side cannot be updated.
None.
This method returns the value of the lock.
None.
None.
This section presents reference information on the ORDSource methods associated with the srcName, srcType, and srcLocation attributes.
void setSourceInformation(String sourceType, String sourceLocation, String sourceName)
package
Sets information about the client-side ORDSource object data source.
The source type.
The source location.
The source name.
None.
None.
None.
void SetSourceType(String sourceType)
package
Sets the client-side ORDSource object source type.
The source type.
None.
None.
None.
void setSourceLocation(String sourceLocation)
package
Sets the client-side ORDSource object source location.
The source location.
None.
None.
None.
void setSourceName(String sourceName)
package
Sets the client-side ORDSource object source name.
The source name.
None.
None.
None.
String getSourceInformation( )
package
Gets the client-side ORDSource object source information.
None.
This method returns the source information in the following format: srcType://srcLocation/srcName.
None.
None.
String getSourceType( )
package
Gets the client-side ORDSource object source type
None.
This method returns the source type.
None.
None.
String getSourceLocation( )
package
Gets the client-side ORDSource object source location.
None.
This method returns the source location.
None.
None.
String getSourceName( )
package
Gets the client-side ORDSource object source name.
None.
This method returns the source name.
None.
None.
This section presents reference information on the ORDSource methods associated with the updateTime attribute.
void setUpdateTime( ) throws SQLException
package
Sets the updated time of both the server-side and client-side ORDSource objects.
None.
None.
java.sql.SQLException
None.
Timestamp getUpdateTime( )
package
Gets the last updated time of the client-side ORDSource object.
None.
This method returns the value of the last update time.
None.
None.
This section presents reference information on the ORDSource methods associated with the local attribute.
void setLocal( )
package
Sets the client-side ORDSource local attribute to true, which indicates that the localData attribute is valid.
None.
None.
None.
None.
boolean isLocal( )
package
Gets the client-side ORDSource object local attribute.
None.
This method returns the value of the local variable.
None.
None.
void clearLocal( )
package
Clears the client-side ORDSource object local attribute.
None.
None.
None.
None.
This section presents reference information on the ORDSource methods associated with communication between the client and the server.
void refresh(boolean forUpdate) throws SQLException
package
Sends information from the server-side object to the client-side object with or without locking the database row.
The indicator for whether or not the option has been refreshed for update. A value of true indicates that the object has been refreshed for update; otherwise, the value is false.
None.
java.sql.SQLException
None.
void flush( ) throws SQLException
package
Copies the client-side object attribute values to the server-side object.
None.
None.
java.sql.SQLException
None.
String getUpdateStr(String mmObjName, String srcObjName)
package
Gets the update String in order to update the database object.
The multimedia object variable.
The source object variable.
This method returns the SQL string to update an ORDSource instance.
None.
None.
This section presents reference information on the ORDSource methods associated with the SQL type.
String getSQLConstructor(boolean updateOption, String mmObjName, String srcObjName)
package
Gets the SQL type constructor for the ORDSource object.
A variable that specifies whether or not the lock is to be taken.
The multimedia object variable. It is set to ORDAudio, ORDImage, or ORDVideo.
The source object variable
This method returns the SQL string that will bind an object instance variable of ORDSource to a database ORDSource object instance.
None.
None.
String defineSQLResults(String var)
package
Defines the SQL results that will be used to assign values to the ORDSource object attributes.
This method is used by the refresh( ) method to assign the server-side object attribute values to the corresponding server-side object attributes.
The name of the source object variable.
This method returns the SQL string that will define the SQL results.
None.
None.
int declareSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Declares the types for the SQL results corresponding to the different ORDSource object attributes.
This method is used by the refresh( ) method to declare the types of the client-side object attributes that are 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
None.
String setSQLParams(String var)
package
Sets the values of the SQL type of the ORDSource 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 source object variable.
This method returns the SQL string that will set the different attributes of the ORDSource object.
None.
None.
int bindInSQLParams(int start, OracleCallableStatement stmt) throws SQLException
package
Binds the values of the SQL type of the ORDSource 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 last index in the statement to which a value was bound.
java.sql.SQLException
None.
int getSQLResults(int start, OracleCallableStatement stmt) throws SQLException
package
Gets the SQL results to assign to the attributes of the ORDSource object (srcLocation or srcType, for example).
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 will bind a client object attribute to the corresponding database object attribute.
java.sql.SQLException
None.
This section presents reference information on the ORDSource methods associated with access operations.
int open(byte[ ] userArg, byte[ ] ctx) throws SQLException
package
Opens the server-side ORDSource object 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
None.
int close(byte[ ] ctx) throws SQLException
package
Closes the server-side ORDSource object 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
None.
int trim(byte[ ] ctx, int newLen) throws SQLException
package
Trims the server-side ORDSource object source to a given length.
The source plug-in context information.
The new length of the content after trimming.
This method returns 0 in case of success or an integer greater than 0 in case of failure.
java.sql.SQLException
None.
This section presents reference information on the ORDSource methods associated with content read and write operations.
int read(byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException
package
Reads from the server-side ORDSource object localData attribute into the buffer.
The source plug-in context information.
The initial reading position in the BLOB.
The number of bytes to be read.
The buffer into which the value is to be read.
This method returns the number of bytes read, or -1 in case of failure.
java.sql.SQLException
None.
int write (byte[ ] ctx, int startPos, int numBytes, byte[ ] buffer) throws SQLException
package
Writes the buffer contents into the server-side ORDSource object localData attribute.
The source plug-in context information.
The start position for writing in the BLOB.
The number of bytes to be written.
The buffer from which the value is to be written into the localData attribute.
This method returns the number of bytes written, or -1 in case of failure.
java.sql.SQLException
None.
This section presents reference information on the ORDSource methods associated with import and export operations.
BLOB importData(byte[ ] ctx, BLOB dlob, StringBuffer mimetype, StringBuffer format) throws SQLException
package
Imports data into the server-side BLOB from the source information in the server-side ORDSource object.
The source plug-in context information.
The LOB locator into which the data is to be imported.
The MIME type of the data.
The format of the data.
This method returns the BLOB locator that contains the imported data.
java.sql.SQLException
None.
BLOB importFrom(byte[ ] ctx, BLOB dlob, StringBuffer mimetype, StringBuffer format, String sourceType, String sourceLocation, String sourceName) throws SQLException
package
Imports data into the server-side BLOB from a data source specified by the parameters.
The source plug-in context information.
The LOB locator into which the data is to be imported.
The MIME type of the data.
The format of the data.
The type of the source from which the data is imported.
The location of the source from which the data is imported.
The name of the source from which the data is imported.
This method returns the LOB locator that contains the imported data.
java.sql.SQLException
None.
void export(byte[ ] ctx, String sourceType, String sourceLocation, String sourceName) throws SQLException
package
Exports data from the server-side ORDSource object to an external source.
The source plug-in context information.
The type of the source into which the data will be exported.
The location of the source into which the data will be exported.
The name of the source into which the data will be exported.
None.
java.sql.SQLException
None.
This section presents reference information on the ORDSource methods associated with source content operations.
int getContentLength( ) throws SQLException
package
Gets the content length of the server-side ORDSource object localData attribute.
None.
This method returns the content length of the source data, in bytes.
java.sql.SQLException
None.
String getSourceAddress( )
package
Returns the client-side ORDSource object source address.
None.
This method returns the source address in the format
srcType://srcLocation/srcName.
None.
None.
BLOB getLocalContent( ) throws SQLException
package
Returns the server-side ORDSource object LOB locator and copies the server side LOB locator to the client side.
None.
This method returns the LOB locator.
java.sql.SQLException
None.
BLOB getContentInTempLob(byte[ ] ctx, BLOB blob, StringBuffer mimetype, StringBuffer format) throws SQLException
package
Gets the server-side ORDSource object localData content in the temporary BLOB, using the default values of duration = 10 and cache = true.
The source plug-in context information.
The value of the temporary BLOB before the call.
The MIME type of the data in the temporary BLOB.
The format of the data in the temporary BLOB.
This method returns the content of the temporary BLOB after the call.
java.sql.SQLException
None.
BLOB getContentInTempLob(byte[ ] ctx, BLOB blob, StringBuffer mimetype, StringBuffer format, int duration, boolean cache) throws SQLException
package
Gets the server-side ORDSource object localData content in the temporary LOB.
The source plug-in context information.
The value of the temporary BLOB before the call.
The MIME type of the data in the temporary BLOB.
The format of the data in the temporary BLOB.
The duration of the call.
The indicator of whether or not to use caching.
This method returns the content of the temporary BLOB after the call.
java.sql.SQLException
None.
void deleteLocalContent( ) throws SQLException
package
Deletes the contents of the server-side ORDSource object localData attribute.
None.
None.
java.sql.SQLException
None.
BFILE getBFILE( ) throws SQLException
package
Gets the server-side ORDSource object BFILE.
This method calls the server-side method getBFILE( ) in the ORDSource object.
None.
This method returns the BFILE.
java.sql.SQLException
None.
This section presents reference information on the ORDSource methods associated with processing commands to the external source.
byte[ ] processCommand(byte[ ] ctx, String command, String arglist, byte[ ] result) throws SQLException
package
Calls the server-side processCommand( ) 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 to be processed.
The argument list for the command to be processed.
The result of executing the command.
This method returns the result of executing the command.
java.sql.SQLException
None.