Skip navigation links

Oracle® Multimedia Java API Reference
11g Release 2 (11.2)

E10779-01


oracle.ord.im
Class OrdMediaUtil

java.lang.Object
  extended by oracle.ord.im.OrdMediaUtil


public class OrdMediaUtil
extends java.lang.Object

The OrdMediaUtil class allows other Oracle Multimedia Java classes to connect to Oracle Database and access data in tables that contain columns of Oracle Multimedia object types. This class includes methods for downloading and uploading data.

Users of this class should be familiar with Oracle Multimedia Reference.

Prerequisites

Before running OrdMediaUtil methods, the following operations must have already been performed:

For examples of making a connection and populating a local object, see Oracle Multimedia User's Guide.


Method Summary
static byte[] getDataInByteArray(oracle.sql.BLOB mediaLobLocator)
          Downloads data from a database object to a byte array.
static boolean getDataInFile(java.lang.String filename, oracle.sql.BLOB mediaLobLocator)
          Downloads data from a database object to the specified file.
static void imCompatibilityInit(oracle.jdbc.OracleConnection con)
          Deprecated. This method is no longer needed.
static void imCompatibilityInit(oracle.jdbc.driver.OracleConnection con)
          Deprecated. This method is no longer needed.
static boolean loadData(java.lang.String filename, oracle.sql.BLOB mediaLobLocator)
          Loads data from the specified file to a BLOB.
static boolean loadDataFromByteArray(byte[] byteArr, oracle.sql.BLOB mediaLobLocator)
          Loads data from a byte array to a BLOB.
static boolean loadDataFromInputStream(java.io.InputStream inStream, oracle.sql.BLOB mediaLobLocator)
          Loads data from an InputStream object to a BLOB.
static void write(java.io.InputStream inStream, java.io.OutputStream outStream)
          Reads the InputStream object and writes to the OutputStream object.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

imCompatibilityInit

public static void imCompatibilityInit(oracle.jdbc.OracleConnection con)
                                throws java.lang.Exception
Deprecated. This method is no longer needed.
Throws:
java.lang.Exception

imCompatibilityInit

public static void imCompatibilityInit(oracle.jdbc.driver.OracleConnection con)
                                throws java.lang.Exception
Deprecated. This method is no longer needed.
Throws:
java.lang.Exception

loadData

public static boolean loadData(java.lang.String filename,
                               oracle.sql.BLOB mediaLobLocator)
                        throws java.sql.SQLException,
                               java.io.IOException
Loads data from the specified file to a BLOB.
Parameters:
filename - the name of the file from which the data is loaded.
mediaLobLocator - the BLOB into which the data is loaded.
Returns:
true if the load is successful; false otherwise.
Throws:
java.sql.SQLException - if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException - if an error occurs reading the data file.

loadDataFromInputStream

public static boolean loadDataFromInputStream(java.io.InputStream inStream,
                                              oracle.sql.BLOB mediaLobLocator)
                                       throws java.sql.SQLException,
                                              java.io.IOException,
                                              java.lang.OutOfMemoryError
Loads data from an InputStream object to a BLOB.
Parameters:
inStream - the name of the InputStream object from which the data is loaded.
mediaLobLocator - the BLOB into which the data is loaded.
Returns:
true if the load is successful; false otherwise.
Throws:
java.sql.SQLException - if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException - if an error occurs reading the InputStream object.
java.lang.OutOfMemoryError - if sufficient memory cannot be allocated to hold the data.

loadDataFromByteArray

public static boolean loadDataFromByteArray(byte[] byteArr,
                                            oracle.sql.BLOB mediaLobLocator)
                                     throws java.sql.SQLException,
                                            java.io.IOException
Loads data from a byte array to a BLOB.
Parameters:
byteArr - the name of the byte [] array from which the data is loaded.
mediaLobLocator - the BLOB into which the data is loaded.
Returns:
true if the load is successful, false otherwise.
Throws:
java.sql.SQLException - if an error occurs accessing an object attribute or executing a method in the database.
java.io.IOException - if an error occurs reading the byte array.

getDataInFile

public static boolean getDataInFile(java.lang.String filename,
                                    oracle.sql.BLOB mediaLobLocator)
                             throws java.sql.SQLException,
                                    java.io.IOException
Downloads data from a database object to the specified file.
Parameters:
filename - the name of the file into which the data is downloaded.
mediaLobLocator - the BLOB from which the data is downloaded.
Returns:
true if the download is successful; false otherwise.
Throws:
java.sql.SQLException - if an error occurs accessing an object attribute.
java.io.IOException - if an error occurs reading the data from the BLOB or writing the data to the output file.

write

public static void write(java.io.InputStream inStream,
                         java.io.OutputStream outStream)
                  throws java.io.IOException
Reads the InputStream object and writes to the OutputStream object.
Parameters:
inStream - the name of the InputStream object from which the data is read.
outStream - the name of the OutputStream object to which data is written.
Throws:
java.io.IOException - if an error occurs reading the data from the InputStream object or writing the data to the OutputStream object, or the InputStream object or the OutputStream object is null.

getDataInByteArray

public static byte[] getDataInByteArray(oracle.sql.BLOB mediaLobLocator)
                                 throws java.sql.SQLException,
                                        java.io.IOException,
                                        java.lang.OutOfMemoryError
Downloads data from a database object to a byte array.
Parameters:
mediaLobLocator - the BLOB from which data is downloaded, and which returns a byte array containing downloaded data.
Throws:
java.sql.SQLException - if an error occurs accessing an object attribute.
java.io.IOException - if an error occurs reading the data from the BLOB.
java.lang.OutOfMemoryError - if sufficient memory cannot be allocated to hold the data.

Skip navigation links

Oracle® Multimedia Java API Reference
11g Release 2 (11.2)

E10779-01


Copyright © 1999, 2009, Oracle and/or its affiliates. All rights reserved.