Skip navigation links

Oracle®Database JDBC Java API Reference
12c Release 1 (12.1.0.2)
E56669-01


oracle.sql
Class BFILE

java.lang.Object
  extended by oracle.sql.Datum
      extended by oracle.sql.DatumWithConnection
          extended by oracle.sql.BFILE

All Implemented Interfaces:
Serializable, oracle.jdbc.internal.ACProxyable, oracle.jdbc.internal.OracleDatumWithConnection, OracleBfile

Deprecated. Use oracle.jdbc.OracleBfile interface for declaration instead of using concrete class oracle.sql.BFILE.

public class BFILE
extends DatumWithConnection
implements oracle.jdbc.internal.OracleBfile

A class for Oracle specific data type BFILE. Use OracleBfile interface for declaration instead of using concrete class oracle.sql.BFILE. OracleBfile has methods declared for all opertions.

Obtaining OracleBfile from a ResultSet

oracle.jdbc.OracleBfile bfile = ((OracleResultSet)resultSet).getBFILE(...); There is no way to create OracleBfile on the client side.

See Also:
OracleBfile, Serialized Form

Field Summary
static int MAX_CHUNK_SIZE
          Deprecated.  
static int MODE_READONLY
          Deprecated.  
static int MODE_READWRITE
          Deprecated.  
static boolean TRACE
          Deprecated.  

 

Constructor Summary
protected BFILE()
          Deprecated.  

 

Method Summary
 InputStream asciiStreamValue()
          Deprecated. Convert to an ascii stream representation of the datum object
 void close()
          Deprecated. Close a previously opened external LOB.
 void closeFile()
          Deprecated. Close the FILE.
 boolean fileExists()
          Deprecated. Find out if a given BFILE (whose locator) points to a file that actually exists on the server's filesystem.
 Object getACProxy()
          Deprecated.  
 InputStream getBinaryStream()
          Deprecated. Retrieve the entire BFILE as a stream.
 InputStream getBinaryStream(long pos)
          Deprecated. Read from the external LOB as a stream at the requested position.
 byte[] getBytes(long pos, int length)
          Deprecated. Return a copy of the contents of the BFILE at the requested position.
 int getBytes(long pos, int length, byte[] buf)
          Deprecated. Copy the contents of the BFILE at the requested position to suppied buffer.
 String getDirAlias()
          Deprecated. Gets the Bfile's directory alias.
 Connection getJavaSqlConnection()
          Deprecated. Oracle extension Return the java.sql.Connection associated with the receiver.
 String getName()
          Deprecated. Gets the Bfile's file name.
 boolean isConvertibleTo(Class jClass)
          Deprecated. Test whether this data object can be converted to the specified Java data type.
 boolean isFileOpen()
          Deprecated. Find out whether a BFILE was opened with the give BFILE.
 boolean isOpen()
          Deprecated. Check whether the external LOB is opened.
 long length()
          Deprecated. The length of the BFILE in bytes.
 void open()
          Deprecated. Open a external LOB in the readonly mode.
 void open(int mode)
          Deprecated. Open a external LOB in the indicated mode.
 void open(LargeObjectAccessMode mode)
          Deprecated. Public method using enum instead of int
 void openFile()
          Deprecated. Open the FILE.
 long position(BFILE pattern, long start)
          Deprecated. Determine the byte position at which the given pattern
 long position(byte[] pattern, long start)
          Deprecated. Determine the byte position at which the given byte pattern
 long position(OracleBfile pattern, long start)
          Deprecated. Determine the byte position at which the given pattern
 void setACProxy(Object w)
          Deprecated.  
 void setBytes(byte[] locator)
          Deprecated. Sets datum value using a byte array.
 Object toJdbc()
          Deprecated. Convert this data object into its default Java object type.

 

Methods inherited from class oracle.sql.DatumWithConnection
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnection

 

Methods inherited from class oracle.sql.Datum
bigDecimalValue, booleanValue, bytesEqual, byteValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass

 

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

 

Methods inherited from interface oracle.jdbc.internal.OracleDatumWithConnection
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue

 

Field Detail

MAX_CHUNK_SIZE

public static final int MAX_CHUNK_SIZE
Deprecated. 
See Also:
Constant Field Values

MODE_READONLY

public static final int MODE_READONLY
Deprecated. 
See Also:
Constant Field Values

MODE_READWRITE

public static final int MODE_READWRITE
Deprecated. 
See Also:
Constant Field Values

TRACE

public static final boolean TRACE
Deprecated. 
See Also:
Constant Field Values

Constructor Detail

BFILE

protected BFILE()
Deprecated. 

Method Detail

length

public long length()
            throws SQLException
Deprecated. 
The length of the BFILE in bytes.
Specified by:
length in interface OracleBfile
Returns:
length of the BFILE in bytes
Throws:
SQLException

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws SQLException
Deprecated. 
Return a copy of the contents of the BFILE at the requested position.
Specified by:
getBytes in interface OracleBfile
Parameters:
pos - is the first byte of the bfile to be extracted.(1-based)
length - is the number of consecutive bytes to be copied.
Returns:
a byte array containing a portion of the BFILE
Throws:
SQLException

getBytes

public int getBytes(long pos,
                    int length,
                    byte[] buf)
             throws SQLException
Deprecated. 
Copy the contents of the BFILE at the requested position to suppied buffer.
Specified by:
getBytes in interface OracleBfile
Parameters:
pos - is the first byte of the bfile to be extracted. (1-based)
length - is the number of consecutive bytes to be copied.
buf - is the buffer to had the extracted bytes.
Returns:
a byte array containing a portion of the BFILE
Throws:
SQLException

getBinaryStream

public InputStream getBinaryStream()
                            throws SQLException
Deprecated. 
Retrieve the entire BFILE as a stream.
Specified by:
getBinaryStream in interface OracleBfile
Returns:
a stream containing the BFILE data
Throws:
SQLException

position

public long position(byte[] pattern,
                     long start)
              throws SQLException
Deprecated. 
Determine the byte position at which the given byte pattern
Specified by:
position in interface OracleBfile
Parameters:
pattern - is the pattern to search for.
start - is the position at which to begin searching. (1-based)
Returns:
the position at which the pattern appears, else -1.
Throws:
SQLException

position

public long position(BFILE pattern,
                     long start)
              throws SQLException
Deprecated. 
Determine the byte position at which the given pattern
Parameters:
pattern - is the pattern to search for.
start - is the position at which to begin searching. (1-based)
Returns:
the position at which the pattern appears, else -1.
Throws:
SQLException

position

public long position(OracleBfile pattern,
                     long start)
              throws SQLException
Deprecated. 
Determine the byte position at which the given pattern
Specified by:
position in interface OracleBfile
Parameters:
pattern - is the pattern to search for.
start - is the position at which to begin searching. (1-based)
Returns:
the position at which the pattern appears, else -1.
Throws:
SQLException

getName

public String getName()
               throws SQLException
Deprecated. 
Gets the Bfile's file name.
Specified by:
getName in interface OracleBfile
Parameters:
bfile - The Bfile for which to get the file name.
Returns:
The file name.
Throws:
SQLException

getDirAlias

public String getDirAlias()
                   throws SQLException
Deprecated. 
Gets the Bfile's directory alias.
Specified by:
getDirAlias in interface OracleBfile
Parameters:
bfile - The Bfile for which to get the directory alias.
Returns:
The directory alias name.
Throws:
SQLException

openFile

public void openFile()
              throws SQLException
Deprecated. 
Open the FILE.
Specified by:
openFile in interface OracleBfile
Parameters:
bfile - The BFILE object to be opened.
Throws:
SQLException

isFileOpen

public boolean isFileOpen()
                   throws SQLException
Deprecated. 
Find out whether a BFILE was opened with the give BFILE.
Specified by:
isFileOpen in interface OracleBfile
Parameters:
bfile - The Bfile to be tested.
Returns:
true if the BFILE was opened, false if it was not opened.
Throws:
SQLException

fileExists

public boolean fileExists()
                   throws SQLException
Deprecated. 
Find out if a given BFILE (whose locator) points to a file that actually exists on the server's filesystem.
Specified by:
fileExists in interface OracleBfile
Parameters:
bfile - The Bfile to be tested.
Returns:
true if the physical file exists, false if it does not exist.
Throws:
SQLException

closeFile

public void closeFile()
               throws SQLException
Deprecated. 
Close the FILE.
Specified by:
closeFile in interface OracleBfile
Parameters:
bfile - The Bfile to be closed.
Throws:
SQLException

getBinaryStream

public InputStream getBinaryStream(long pos)
                            throws SQLException
Deprecated. 
Read from the external LOB as a stream at the requested position.
Specified by:
getBinaryStream in interface OracleBfile
Parameters:
pos - is the position data to be read.
Returns:
a input stream to read data from the BFILE
Throws:
SQLException
Since:
8.2.0

open

public void open()
          throws SQLException
Deprecated. 
Open a external LOB in the readonly mode. It is an error to open the same LOB twice.
Throws:
SQLException
Since:
8.2.0

open

public void open(LargeObjectAccessMode mode)
          throws SQLException
Deprecated. 
Public method using enum instead of int
Specified by:
open in interface OracleBfile
Throws:
SQLException

open

public void open(int mode)
          throws SQLException
Deprecated. 
Open a external LOB in the indicated mode. Valid modes include MODE_READONLY only. It is an error to open the same LOB twice.
Throws:
SQLException
Since:
8.2.0

close

public void close()
           throws SQLException
Deprecated. 
Close a previously opened external LOB.
Specified by:
close in interface OracleBfile
Throws:
SQLException
Since:
8.2.0

isOpen

public boolean isOpen()
               throws SQLException
Deprecated. 
Check whether the external LOB is opened.
Specified by:
isOpen in interface OracleBfile
Returns:
true if the LOB is opened.
Throws:
SQLException
Since:
8.2.0

toJdbc

public Object toJdbc()
              throws SQLException
Deprecated. 
Convert this data object into its default Java object type.
Specified by:
toJdbc in interface oracle.jdbc.internal.OracleDatumWithConnection
Specified by:
toJdbc in class Datum
Returns:
this object.
Throws:
SQLException - if any of the lower layer code throws an exception.

isConvertibleTo

public boolean isConvertibleTo(Class jClass)
Deprecated. 
Test whether this data object can be converted to the specified Java data type.
Specified by:
isConvertibleTo in interface oracle.jdbc.internal.OracleDatumWithConnection
Specified by:
isConvertibleTo in class Datum
Parameters:
jClass - specifies the Java data type to test against.
Returns:
true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.

asciiStreamValue

public InputStream asciiStreamValue()
                             throws SQLException
Deprecated. 
Convert to an ascii stream representation of the datum object
Specified by:
asciiStreamValue in interface oracle.jdbc.internal.OracleDatumWithConnection
Overrides:
asciiStreamValue in class Datum
Returns:
ascii stream representation of the datum object
Throws:
SQLException, - if no ascii stream representation exists
SQLException

getJavaSqlConnection

public Connection getJavaSqlConnection()
                                throws SQLException
Deprecated. 
Description copied from class: DatumWithConnection
Oracle extension Return the java.sql.Connection associated with the receiver. Since 9.0.0 not all Oracle JDBC connection objects are assignment compatible with oracle.jdbc.driver.OracleConnection. If the connection is wrapped, return the outermost wrapper.
Specified by:
getJavaSqlConnection in interface oracle.jdbc.internal.OracleDatumWithConnection
Overrides:
getJavaSqlConnection in class DatumWithConnection
Returns:
the connection
Throws:
SQLException - if an error occurs

setBytes

public void setBytes(byte[] locator)
Deprecated. 
Description copied from class: Datum
Sets datum value using a byte array. The byte array is copied.
Specified by:
setBytes in interface oracle.jdbc.internal.OracleDatumWithConnection
Overrides:
setBytes in class Datum
Parameters:
locator - byte array used to set the datum value

setACProxy

public void setACProxy(Object w)
Deprecated. 
Specified by:
setACProxy in interface oracle.jdbc.internal.ACProxyable

getACProxy

public Object getACProxy()
Deprecated. 
Specified by:
getACProxy in interface oracle.jdbc.internal.ACProxyable

Skip navigation links

Oracle®Database JDBC Java API Reference
12c Release 1 (12.1.0.2)
E56669-01


Copyright © 2008, 2014, Oracle and/or its affiliates. All rights reserved.