Oracle® interMedia Java Classes User's Guide and Reference Release 9.2 Part No. A96121-01 |
|
The OrdImage class is used to represent an instance of the ORDSYS.ORDImage database type in a Java application. The OrdImage class includes a set of methods to get and set various object attributes, as well as a set of methods that perform various operations on an OrdImage Java object.
Almost all methods operate on the attributes of the OrdImage Java object in the application. The exceptions are those methods that access the image data for read or write purposes, which are described in the following list:
Methods that operate on the database BLOB specified by the localData attribute, read and write data stored in the database BLOB.
Methods that operate on the database BFILE specified by the srcLocation and srcName attributes when the srcType attribute is "file," read data from the specified file in the database server.
Methods that operate on the URL specified by the srcType, srcLocation, and srcName attributes when the srcType attribute is "http," read data from the resource at the specified URL.
If your application modifies the OrdImage Java object, or the image data in the database, you must update the ORDImage SQL object in the database to make those changes permanent.
Some methods invoked at the OrdImage level are handed off to the database source plug-in for processing; these methods have byte [ ] [ ] ctx
as a context parameter. In cases where a client system is connecting to a database server, the space for the parameter is created by the client (in the reference examples, 64 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.
Some methods in the OrdImage Java class are handed off to a database source plug-in or database format plug-in for processing; these methods have byte [ ] [ ] ctx
as a context parameter. Applications should allocate a 64-byte array to hold any context information that may be required by a source plug-in or a format plug-in. For example, a plug-in may initialize the context information in one call and use that information in a subsequent call. The source plug-in context requires one array; the format plug-in context requires another array. For most plug-ins, 64 bytes should be sufficient. Some user-defined plug-ins may need additional space. The following example shows how to allocate a plug-in context information array:
byte [] [] ctx = new byte[1][64];
Note: In the current release, no Oracle-supplied source plug-ins or format plug-ins maintain context. Also, not all user-written source plug-ins or format plug-ins maintain context. However, if you include the context parameter as described, your application should work with any current or future source plug-ins or format plug-ins. |
See Oracle interMedia User's Guide and Reference for more information about plug-ins.
You will need to include the following import statements in your Java file in order to run interMedia methods:
import java.sql.*; import java.io.*; import oracle.jdbc.driver.*; import oracle.sql.*; import oracle.ord.im.*;
The examples in this reference chapter are based on the assumption that the following operations have already been performed:
A connection has been made to a table that contains a column of type OrdImage.
A local OrdImage object named imgObj has been created and populated with data.
For examples of making a connection and populating a local object, see Section 2.3.2.
This section presents reference information on the methods that operate on OrdImage objects.
Format
public boolean checkProperties( )
Description
Checks if the properties of the image data are consistent with the attributes of the OrdImage Java object.
Parameters
None.
Return Value
This method returns true if the properties of the image data are consistent with the attributes of the OrdImage Java object; false otherwise.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding checkProperties( ) method in the database.
Examples
if(imgObj.checkProperties( )) System.out.println("checkProperties successful");
Format
public void clearLocal( )
Description
Clears the local attribute to indicate that the image data is stored externally.
Parameters
None.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the local attribute.
Examples
imgObj.clearLocal( );
Format
public void copy(OrdImage dest)
Description
Copies an OrdImage Java object. This method calls the corresponding copy( ) method in the database. The copy( ) method copies all the attributes of the current OrdImage object to the destination OrdImage object with the exception of the BLOB specified by the localData attribute. If the image data is stored locally in the database, then the data is copied from the BLOB specified by the localData attribute in the current OrdImage object to the BLOB specified by the localData attribute in the destination object.
Parameters
The destination OrdImage object to which the data will be copied.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs calling the corresponding copy( ) method in the database.
Examples
//create and populate an object named imgObj2 imgObj.copy(imgObj2);
where
imgObj2: is an OrdImage object that will receive the image data from imgObj.
Format
public void deleteContent( )
Description
Deletes any data stored in the database BLOB specified by the localData attribute.
Parameters
None.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding deleteContent( ) method in the database.
Examples
imgObj.deleteContent( );
Format
public void export (byte[ ] [ ], ctx String srcType, String srcLocation, String srcName)
Description
Exports the data from the BLOB specified by the localData attribute. This method calls the corresponding export( ) method in the database to export the image data to a location specified by the srcType, srcLocation, and srcName parameters.
Not all source plug-ins support the export( ) method. For example, the "file" source type is the only Oracle-supplied source type that supports the export( ) method.
This method will work only if you are running Oracle database server release 8.1.7 or later.
The remainder of this description describes the use of the export( ) method and the Oracle-supplied "file" source plug-in. User-written plug-ins will behave differently.
The export( ) method implemented by the Oracle-supplied "file" source plug-in copies, but does not modify, the media data stored in the database BLOB specified by the localData attribute.
After exporting the image data, all the image property attributes remain unchanged, however, the srcType, srcLocation, and srcName attributes are updated with values of the srcType, srcLocation, and srcName parameters passed to the export( ) method. After calling the export( ) method, if you no longer intend to manage the image data within the database, call the clearLocal( ) method to indicate the image data is stored outside the database and call the deleteContent( ) method to delete the image data stored in the database BLOB.
The export( ) method in the database writes only to a database directory object that the user has privileges to access. That is, you can access a directory that you have created using the SQL CREATE DIRECTORY statement, or one to which you have been granted READ access. To execute the CREATE DIRECTORY statement, you must have the CREATE ANY DIRECTORY privilege. In addition, you must use the DBMS_JAVA.GRANT_PERMISSION method to specify which files can be written.
For example, the following SQL*Plus command grants the user, MEDIAUSER, the permission to write to the file named scenery1.jpg:
CALL DBMS_JAVA.GRANT_PERMISSION(
'MEDIAUSER',
'java.io.FilePermission',
'/images/outdoors/scenery1.jpg',
'write');
The previous example shows how to authorize access to write to a single file. In addition, there are various wildcard path specifications that authorize write access to multiple directories and file names. For example, a path specification that ends in a slash and asterisk (/*), where the slash is the file-separator character that is operating-system dependent, indicates all the files contained in the specified directory. A path specification that ends with a slash and hyphen (/-) indicates all files contained in the specified directory and all its subdirectories. A path name consisting of the special token <<ALL FILES>> authorizes access to any file.
See Oracle9i Java Developer's Guide and the java.io.FilePermission class in the Java API for more information about security and performance. See Oracle interMedia User's Guide and Reference for more information about the required privileges.
Parameters
The source plug-in context information.
The source type to which the content will be exported.
The source location to which the content will be exported.
The source name to which the content will be exported.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding export( ) method in the database.
Examples
byte [ ] [ ] ctx = new byte[1][64]; imgObj.export(ctx,"file","IMAGEDIR","image.gif");
where:
ctx: contains the source plug-in context information.
file: is the source plug-in used to export the content.
IMAGEDIR: is the location on the database server to which the content will be exported.
image.gif: is the file to which the content will be exported.
Format
public oracle.sql.BFILE getBFILE( )
Description
Returns a BFILE locator from the database when the srcType attribute is "file." This method calls the corresponding getBFILE( ) method in the database, which creates the BFILE using the srcLocation and srcName attributes.
Parameters
None.
Return Value
This method returns an oracle.sql.BFILE locator.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding getBFILE( ) method in the database.
Examples
BFILE imageBFILE = imgObj.getBFILE( );
Format
public String getCompressionFormat( )
Description
Returns the value of the compressionFormat attribute.
Parameters
None.
Return Value
This method returns the value of the compressionFormat attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the compressionFormat attribute.
Examples
String compression = imgObj.getCompressionFormat( );
Format
public oracle.sql.BLOB getContent( )
Description
Returns the BLOB locator from the localData attribute.
Parameters
None.
Return Value
This method returns an oracle.sql.BLOB locator.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the localData attribute.
Examples
BLOB localContent = imgObj.getContent( );
Format
public String getContentFormat( )
Description
Returns the value of the contentFormat attribute.
Parameters
None.
Return Value
This method returns the value of the contentFormat attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the contentFormat attribute.
Examples
String format = imgObj.getContentFormat( );
Format
public int getContentLength( )
Description
Returns the value of the contentLength attribute.
Parameters
None.
Return Value
This method returns the value of the contentLength attribute, as an integer.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the contentLength attribute.
Examples
int length = imgObj.getContentLength( );
Format
public byte[ ] getDataInByteArray( )
Description
Returns a byte array containing the data from the database BLOB specified by the localData attribute.
Parameters
None.
Return Value
This method returns the byte array containing the data.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute.
java.io.IOException
This exception is thrown if an error occurs reading the data from the BLOB.
java.lang.OutOfMemoryError
This exception is thrown if sufficient memory cannot be allocated to hold the data.
Examples
See Section 2.3.2.8 for an example of this method.
Format
public boolean getDataInFile(String filename)
Description
Writes the data from the database BLOB specified by the localData attribute to a local file.
Parameters
The name of the file to which the data will be written.
Return Value
This method returns true if the data is written to the file successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute.
java.io.IOException
This exception is thrown if an error occurs reading the data from the BLOB or writing the data to the output file.
Examples
See Section 2.3.2.6 for an example of this method.
Format
public InputStream getDataInStream( )
Description
Returns an InputStream object from which the data in the database BLOB specified by the localData attribute can be read.
Parameters
None.
Return Value
This method returns an InputStream object from which the data will be read.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute.
Examples
See Section 2.3.2.7 for an example of this method.
Format
public static oracle.sql.CustomDatumFactory getFactory( )
Description
Returns the OrdImage CustomDatumFactory interface for use by the getCustomDatum( ) method. Specify the getFactory( ) method as the factory parameter of the getCustomDatum( ) method when retrieving an OrdImage object from an OracleResultSet or OracleCallableStatement object.
Parameters
None.
Return Value
This method returns the OrdImage implementation of the CustomDatumFactory interface.
Exceptions
None.
Examples
OrdImage img = (OrdImage)rset.getCustomDatum( 1, OrdImage.getFactory() );
Format
public String getFormat( )
Description
Returns the value of the fileFormat attribute.
Parameters
None.
Return Value
This method returns the value of the fileFormat attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the fileFormat attribute.
Examples
String format = imgObj.getFormat( );
Format
public int getHeight( )
Description
Returns the value of the height attribute.
Parameters
None.
Return Value
This method returns the value of the height attribute, as an integer.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the height attribute.
Examples
int height = imgObj.getHeight( );
Format
public String getMimeType( )
Description
Returns the value of the mimeType attribute.
Parameters
None.
Return Value
This method returns the value of the mimeType attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the mimeType attribute.
Examples
String mime = imgObj.getMimeType( );
Format
public String getSource( )
Description
Returns the source information in the form: srcType://srcLocation/srcName.
Parameters
None.
Return Value
This method returns the source information, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding getSource( ) method in the database.
Examples
String sourceName = imgObj.getSource( );
Format
public String getSourceLocation( )
Description
Returns the value of the srcLocation attribute.
Parameters
None.
Return Value
This method returns the value of the srcLocation attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the srcLocation attribute.
Examples
String location = imgObj.getSourceLocation( );
Format
public String getSourceName( )
Description
Returns the value of the srcName attribute.
Parameters
None.
Return Value
This method returns the value of the srcName attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the srcName attribute.
Examples
String name = imgObj.getSourceName( );
Format
public String getSourceType( )
Description
Returns the value of the srcType attribute.
Parameters
None.
Return Value
This method returns the value of the srcType attribute, as a String.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the srcType attribute.
Examples
String type = imgObj.getSourceType( );
Format
public java.sql.Timestamp getUpdateTime( )
Description
Returns the value of the updateTime attribute.
Parameters
None.
Return Value
This method returns the value of the updateTime attribute as a java.sql.Timestamp object.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the updateTime attribute.
Examples
Timestamp time = imgObj.getUpdateTime( );
Format
public int getWidth( )
Description
Returns the value of the width attribute.
Parameters
None.
Return Value
This method returns the value of the width attribute, as an integer.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the width attribute.
Examples
int width = imgObj.getWidth( );
Format
public void importData(byte[ ] [ ] ctx)
Description
Imports data from an external source into the database BLOB specified by the localData attribute. The external data source is specified by the srcType, srcLocation, and srcName attributes. After importing the image data, by default, this method automatically calls the setProperties( ) method in the database to set the property attributes. If you are importing a foreign image whose format is not understood by interMedia, call the setFormat( ) method to set the fileFormat to a String beginning with "other" to disable the automatic call to the setProperties( ) method.
Parameters
The source plug-in context information.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding import( ) method or the setProperties( ) method in the database.
Examples
byte [ ] [ ] ctx = new byte[1][64]; imgObj.importData(ctx)
where:
ctx: contains the source plug-in context information.
Format
public void importFrom(byte[ ] [ ] ctx, String srcType, String srcLocation, String srcName)
Description
Imports data from an external source into the database BLOB specified by the localData attribute. The external data source is specified by the srcType, srcLocation, and srcName parameters. The srcType, srcLocation, and srcName attributes are updated with values of the srcType, srcLocation, and srcName parameters passed to the importFrom( ) method. After importing the image data, by default, this method automatically calls the setProperties( ) method in the database to set the property attributes. If you are importing a foreign image whose format is not understood by interMedia, call the setFormat( ) method to set the fileFormat to "other" to disable the automatic call to the setProperties( ) method.
Parameters
The source plug-in context information. See Oracle interMedia User's Guide and Reference for more information.
The source type from which the data will be imported.
The source location from which the data will be imported.
The source name from which the data will be imported.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding importFrom( ) method or the setProperties( ) method in the database.
Examples
byte [ ] [ ] ctx = new byte[1][64]; imgObj.importFrom(ctx,"file","IMAGEDIR","testimg.dat");
where:
ctx: contains the source plug-in context information.
file: is the source plug-in used to import the data.
IMAGEDIR: is the location of the file from which the data will be imported.
testimg.dat: is the file from which the data will be imported.
Format
public boolean isLocal( )
Description
Indicates if the image data is stored locally in the database in a BLOB specified by the localData attribute.
Parameters
None.
Return Value
This method returns true if the data is stored locally in the database in a BLOB; false otherwise.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the localData attribute.
Examples
if(imgObj.isLocal( )) System.out.println("local attribute is true"); else System.out.println("local attribute is false");
Format
public boolean loadDataFromByteArray(byte[ ] byteArr)
Description
Loads data from a byte array into the database BLOB specified by the localData attribute. Before loading the data, this method calls the deleteContent( ) method to delete any existing data in the BLOB. It also calls the setLocal( ) method to set the local flag. In addition, this method calls the setUpdateTime( ) method to set the updateTime attribute to the database server's current SYSDATE time.
Parameters
The name of the byte array from which the data will be loaded.
Return Value
This method returns true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException
This exception is thrown if an error occurs reading the byte array.
Examples
See Section 2.3.2.8 for an example of this method.
Format
public boolean loadDataFromFile(String filename)
Description
Loads data from a file into the database BLOB specified by the localData attribute. Before loading the data, this method calls the deleteContent( ) method to delete any existing data in the BLOB. It also calls the setLocal( ) method to set the local flag. In addition, this method calls the setUpdateTime( ) method to set the updateTime attribute to the database server's current SYSDATE time.
Parameters
The name of the file from which the data will be loaded.
Return Value
This method returns true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException
This exception is thrown if an error occurs reading the data file.
Examples
See Section 2.3.2.6 for an example of this method.
Format
public boolean loadDataFromInputStream(InputStream inpStream)
Description
Loads data from an InputStream object into the database BLOB specified by the localData attribute. Before loading the data, this method calls the deleteContent( ) method to delete any existing data in the BLOB. It also calls the setLocal( ) method to set the local flag. In addition, this method calls the setUpdateTime( ) method to set the updateTime attribute to the database server's current SYSDATE time.
Parameters
The name the InputStream object from which the data will be loaded.
Return Value
This method returns true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException
This exception is thrown if an error occurs reading the InputStream object.
Examples
See Section 2.3.2.7 for an example of this method.
Format
public void process(String cmd)
Description
Performs one or more image processing operations on the image data in the database BLOB specified by the localData attribute. This method calls the corresponding process( ) method in the database to perform the image processing operations specified by the cmd parameter.
See Oracle interMedia User's Guide and Reference for more information on the various image processing operations that can be performed on an image.
Parameters
A String that specifies a list of image processing operations to perform on the image.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding process( ) method in the database.
Examples
imgObj.process("fileFormat=JFIF");
where:
fileFormat=JFIF: is the command to be executed.
Format
public void processCopy(String cmd, OrdImage dest)
Description
Copies the image data to the destination object and performs one or more image processing operations on the image data. If the source image data is stored externally to the database, then it is imported into the database BLOB specified by the localData attribute in the destination OrdImage object. Otherwise, the image data is copied from the BLOB specified by localData attribute in the current OrdImage object to the BLOB specified by the localData attribute in the destination object.
Parameters
A String that specifies a list of image processing operations to perform on the image.
The destination OrdImage object.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs calling the corresponding processCopy( ) method in the database.
Examples
//create and populate an OrdImage object named imgObj2 imgObj.processCopy("maxScale=32 32, fileFormat= GIFF", imgObj2);
where:
maxScale=32 32, fileFormat= GIFF: is the command to be executed.
imgObj2: is the object that will receive the results of executing the command.
Format
public void setCompressionFormat(String CompressionFormat)
Description
Sets the value of the compressionFormat attribute.
The setProperties( ) method sets this attribute automatically for certain media formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the media data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the compressionFormat attribute.
Examples
None.
Format
public void setContentFormat(String ContentFormat)
Description
Sets the value of the contentFormat attribute.
The setProperties( ) method sets this attribute automatically for certain media formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the media data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the contentFormat attribute.
Examples
None.
Format
public void setContentLength(int ContentLength)
Description
Sets the value of the contentLength attribute.
The setProperties( ) method sets this attribute automatically for certain media formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the media data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the contentLength attribute.
Examples
None.
Format
public void setFormat(String Format)
Description
Sets the value of the fileFormat attribute.
The setProperties( ) method sets this attribute automatically for certain media formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the media data itself. Set the fileFormat attribute to a String beginning with "other" to disable the automatic call to the setProperties( ) method by the importData( ) and importFrom( ) methods.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the fileFormat attribute.
Examples
None.
Format
public void setHeight(int Height)
Description
Sets the value of the height attribute.
The setProperties( ) method sets this attribute automatically for certain image formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the image data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the height attribute.
Examples
imgObj.setHeight(24);
where:
24: is the value to be set, in pixels, in the height attribute.
Format
public void setLocal( )
Description
Sets the value of the local attribute to indicate that the image data is stored locally in the database in a BLOB specified by the localData attribute.
Parameters
None.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the localData attribute.
Examples
imgObj.setLocal( );
Format
public void setMimeType(String mimeType)
Description
Sets the value of the mimeType attribute.
The setProperties( ) method sets this attribute automatically for certain media formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the media data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the mimeType attribute.
Examples
imgObj.setMimeType("image/bmp");
where:
image/bmp: is the MIME type to be set.
Format
public void setProperties( )
Description
Parses the image data properties and sets the values of the attributes in the OrdImage Java object. This method sets the values of the height, width, contentLength, fileFormat, contentFormat, compressionFormat, and mimeType attributes. An attribute is set to null if the corresponding property cannot be extracted for a specific image format. This method throws a SQLException error if the image format is not recognized.
Parameters
None.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding setProperties( ) method in the database.
Examples
imgObj.setProperties( );
Format
public void setProperties(String description)
Description
Writes the characteristics of a foreign image into the appropriate attribute fields. This method sets the values of various attributes of the OrdImage object based on a set of characteristics that describe the image properties. With this information, interMedia is able to process certain foreign image formats. For more information on setting image characteristics for foreign images, see Oracle interMedia User's Guide and Reference.
Parameters
A String that specifies the image characteristics to set for the foreign image.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding setProperties( ) method in the database.
Examples
String properties = "width=123 height=321 compressionformat=NONE userString=DJM dataOffset=128 scanlineOrder=INVERSE pixelOrder=REVERSE interleaving=BIL numberOfBands=1 defaultChannelSelection=1"; imgObj.setProperties(properties);
where:
properties: is a String that contains the properties to be set.
Format
public void setSource(String srcType, String srcLocation, String srcName)
Description
Sets the values of the srcType, srcLocation, and srcName attributes.
Parameters
The type of the source.
The location of the source.
The name of the source.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the srcType, srcLocation, or srcName attributes.
Examples
imgObj.setSource("file","IMAGEDIR","jdoe.gif");
where:
file: is the source type.
IMAGEDIR: is the source location.
jdoe.gif: is the source name.
Format
public void setUpdateTime(java.sql.Timestamp currentTime)
Description
Sets the value of the updateTime attribute. This method sets the value of the updateTime attribute to the specified time, or to the database server's current SYSDATE time if the currentTime attribute is specified as null.
Parameters
The update time, or the null value, used to set the value of the updateTime attribute to the database server's current SYSDATE time.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs executing the corresponding setUpdateTime( ) method in the database.
Examples
imgObj.setUpdateTime(null);
Format
public void setWidth(int Width)
Description
Sets the value of the width attribute.
The setProperties( ) method sets this attribute automatically for certain image formats; use this method only if you are not using the setProperties( ) method. This method sets only the attribute value; it does not modify the image data itself.
Parameters
The new attribute value.
Return Value
None.
Exceptions
java.sql.SQLException
This exception is thrown if an error occurs accessing the width attribute.
Examples
imgObj.setWidth(24);
where:
24: is the value to be set, in pixels, in the width attribute.
|
Copyright © 1999, 2002 Oracle Corporation All rights reserved |
|