Class BFILE
- java.lang.Object
-
- oracle.sql.Datum
-
- oracle.sql.DatumWithConnection
-
- oracle.sql.BFILE
-
- All Implemented Interfaces:
java.io.Serializable
,oracle.jdbc.internal.ACProxyable
,oracle.jdbc.internal.OracleBfile
,oracle.jdbc.internal.OracleConcreteProxy
,oracle.jdbc.internal.OracleDatumWithConnection
,OracleBfile
public class BFILE extends DatumWithConnection implements oracle.jdbc.internal.OracleBfile, oracle.jdbc.internal.OracleConcreteProxy
Deprecated.Use oracle.jdbc.OracleBfile interface for declaration instead of using concrete class oracle.sql.BFILE.A class for Oracle specific data type BFILE. UseOracleBfile
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 createOracleBfile
on the client side.- See Also:
OracleBfile
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_CHUNK_SIZE
Deprecated.static int
MODE_READONLY
Deprecated.static int
MODE_READWRITE
Deprecated.protected oracle.jdbc.driver.OracleBfile
target
Deprecated.-
Fields inherited from class oracle.sql.DatumWithConnection
targetDatumWithConnection
-
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BFILE()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.io.InputStream
asciiStreamValue()
Deprecated.Convert to an ascii stream representation of the datum objectvoid
closeFile()
Deprecated.Close the FILE.void
closeLob()
Deprecated.Close a previously opened external LOB.boolean
fileExists()
Deprecated.Find out if a given BFILE (whose locator) points to a file that actually exists on the server's filesystem.java.io.InputStream
getBinaryStream()
Deprecated.Retrieve the entire BFILE as a stream.java.io.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.java.lang.String
getDirAlias()
Deprecated.Gets the Bfile's directory alias.java.sql.Connection
getJavaSqlConnection()
Deprecated.Oracle extension Return the java.sql.Connection associated with the receiver.java.lang.String
getName()
Deprecated.Gets the Bfile's file name.oracle.jdbc.driver.OracleBfile
getTarget()
Deprecated.boolean
isConvertibleTo(java.lang.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
isOpenLob()
Deprecated.Check whether the external LOB is opened.long
length()
Deprecated.The length of the BFILE in bytes.void
open()
Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification.void
open(int mode)
Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification.void
openFile()
Deprecated.Open the FILE.void
openLob()
Deprecated.Open a external LOB in the readonly mode.void
openLob(int mode)
Deprecated.Open a external LOB in the indicated mode.void
openLob(LargeObjectAccessMode mode)
Deprecated.Public method using enum instead of intlong
position(byte[] pattern, long start)
Deprecated.Determine the byte position at which the given byte patternlong
position(OracleBfile pattern, long start)
Deprecated.Determine the byte position at which the given patternlong
position(BFILE pattern, long start)
Deprecated.Determine the byte position at which the given patternjava.util.concurrent.Flow.Publisher<byte[]>
publisherOracle(long position, ErrorSet continueOnErrorSet)
Deprecated.Returns aPublisher
that publishes the content of thisBFile
beginning at the specified position.void
setBytes(byte[] locator)
Deprecated.Sets datum value using a byte array.java.lang.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, bytesHashCode, 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.OracleBfile
close, isOpen, open
-
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
-
target
protected oracle.jdbc.driver.OracleBfile target
Deprecated.
-
-
Method Detail
-
getTarget
public oracle.jdbc.driver.OracleBfile getTarget()
Deprecated.
-
length
public long length() throws java.sql.SQLException
Deprecated.The length of the BFILE in bytes.- Specified by:
length
in interfaceOracleBfile
- Returns:
- length of the BFILE in bytes
- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
Deprecated.Return a copy of the contents of the BFILE at the requested position.- Specified by:
getBytes
in interfaceOracleBfile
- 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:
java.sql.SQLException
-
getBytes
public int getBytes(long pos, int length, byte[] buf) throws java.sql.SQLException
Deprecated.Copy the contents of the BFILE at the requested position to suppied buffer.- Specified by:
getBytes
in interfaceOracleBfile
- 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:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
Deprecated.Retrieve the entire BFILE as a stream.- Specified by:
getBinaryStream
in interfaceOracleBfile
- Returns:
- a stream containing the BFILE data
- Throws:
java.sql.SQLException
-
position
public long position(byte[] pattern, long start) throws java.sql.SQLException
Deprecated.Determine the byte position at which the given byte pattern- Specified by:
position
in interfaceOracleBfile
- 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:
java.sql.SQLException
-
position
public long position(BFILE pattern, long start) throws java.sql.SQLException
Deprecated.Determine the byte position at which the given pattern- Specified by:
position
in interfaceoracle.jdbc.internal.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:
java.sql.SQLException
-
position
public long position(OracleBfile pattern, long start) throws java.sql.SQLException
Deprecated.Determine the byte position at which the given pattern- Specified by:
position
in interfaceOracleBfile
- 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:
java.sql.SQLException
-
getName
public java.lang.String getName() throws java.sql.SQLException
Deprecated.Gets the Bfile's file name.- Specified by:
getName
in interfaceOracleBfile
- Parameters:
bfile
- The Bfile for which to get the file name.- Returns:
- The file name.
- Throws:
java.sql.SQLException
-
getDirAlias
public java.lang.String getDirAlias() throws java.sql.SQLException
Deprecated.Gets the Bfile's directory alias.- Specified by:
getDirAlias
in interfaceOracleBfile
- Parameters:
bfile
- The Bfile for which to get the directory alias.- Returns:
- The directory alias name.
- Throws:
java.sql.SQLException
-
openFile
public void openFile() throws java.sql.SQLException
Deprecated.Open the FILE.- Specified by:
openFile
in interfaceOracleBfile
- Parameters:
bfile
- The BFILE object to be opened.- Throws:
java.sql.SQLException
-
isFileOpen
public boolean isFileOpen() throws java.sql.SQLException
Deprecated.Find out whether a BFILE was opened with the give BFILE.- Specified by:
isFileOpen
in interfaceOracleBfile
- Parameters:
bfile
- The Bfile to be tested.- Returns:
- true if the BFILE was opened, false if it was not opened.
- Throws:
java.sql.SQLException
-
fileExists
public boolean fileExists() throws java.sql.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 interfaceOracleBfile
- Parameters:
bfile
- The Bfile to be tested.- Returns:
- true if the physical file exists, false if it does not exist.
- Throws:
java.sql.SQLException
-
closeFile
public void closeFile() throws java.sql.SQLException
Deprecated.Close the FILE.- Specified by:
closeFile
in interfaceOracleBfile
- Parameters:
bfile
- The Bfile to be closed.- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos) throws java.sql.SQLException
Deprecated.Read from the external LOB as a stream at the requested position.- Specified by:
getBinaryStream
in interfaceOracleBfile
- Parameters:
pos
- is the position data to be read.- Returns:
- a input stream to read data from the BFILE
- Throws:
java.sql.SQLException
- Since:
- 8.2.0
-
open
@Deprecated(since="23.5", forRemoval=true) public void open() throws java.sql.SQLException
Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call toopenLob()
, which provides the exact same behavior.Open a external LOB in the readonly mode. It is an error to open the same LOB twice.- Throws:
java.sql.SQLException
- Since:
- 8.2.0
-
openLob
public void openLob() throws java.sql.SQLException
Deprecated.Open a external LOB in the readonly mode. It is an error to open the same LOB twice.- Throws:
java.sql.SQLException
- Since:
- 23.5
-
openLob
public void openLob(LargeObjectAccessMode mode) throws java.sql.SQLException
Deprecated.Public method using enum instead of int- Specified by:
openLob
in interfaceOracleBfile
- Throws:
java.sql.SQLException
- Since:
- 23.5
-
open
@Deprecated(since="23.5", forRemoval=true) public void open(int mode) throws java.sql.SQLException
Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call toopenLob(int)
, which provides the exact same behavior.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:
java.sql.SQLException
- Since:
- 8.2.0
-
openLob
public void openLob(int mode) throws java.sql.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:
java.sql.SQLException
- Since:
- 23.5
-
closeLob
public void closeLob() throws java.sql.SQLException
Deprecated.Close a previously opened external LOB.- Specified by:
closeLob
in interfaceOracleBfile
- Throws:
java.sql.SQLException
- Since:
- 23.5
-
isOpenLob
public boolean isOpenLob() throws java.sql.SQLException
Deprecated.Check whether the external LOB is opened.- Specified by:
isOpenLob
in interfaceOracleBfile
- Returns:
- true if the LOB is opened.
- Throws:
java.sql.SQLException
- Since:
- 23.5
-
toJdbc
public java.lang.Object toJdbc() throws java.sql.SQLException
Deprecated.Convert this data object into its default Java object type.
-
isConvertibleTo
public boolean isConvertibleTo(java.lang.Class<?> jClass)
Deprecated.Test whether this data object can be converted to the specified Java data type.- Specified by:
isConvertibleTo
in interfaceoracle.jdbc.internal.OracleBfile
- Specified by:
isConvertibleTo
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Specified by:
isConvertibleTo
in classDatum
- 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 java.io.InputStream asciiStreamValue() throws java.sql.SQLException
Deprecated.Convert to an ascii stream representation of the datum object- Specified by:
asciiStreamValue
in interfaceoracle.jdbc.internal.OracleBfile
- Specified by:
asciiStreamValue
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Overrides:
asciiStreamValue
in classDatum
- Returns:
- ascii stream representation of the datum object
- Throws:
java.sql.SQLException
-
getJavaSqlConnection
public java.sql.Connection getJavaSqlConnection() throws java.sql.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 interfaceoracle.jdbc.internal.OracleBfile
- Specified by:
getJavaSqlConnection
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Overrides:
getJavaSqlConnection
in classDatumWithConnection
- Returns:
- the connection
- Throws:
java.sql.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.
-
publisherOracle
public final java.util.concurrent.Flow.Publisher<byte[]> publisherOracle(long position, ErrorSet continueOnErrorSet) throws java.sql.SQLException
Deprecated.Description copied from interface:OracleBfile
Returns aPublisher
that publishes the content of thisBFile
beginning at the specified position. The argument to each call toSubscriber.onNext
will contain an implementation defined number of bytes.Calling any method of this
BFile
exceptfileExists()
,getDirAlias()
,getName()
, or one defined byObject
between the time this method is called and the time when the returned publisher terminates will block.The returned publisher terminates once all subscribers have received
Subscriber.onComplete
, receivedSubscriber.onError
, or cancelled their subscription.Upon signalling demand to the returned
Publisher
, LOB read operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in thecontinueOnErrorSet
, the pipeline will abort all subsequent asynchronous operations, up to the next#resume()
.- Specified by:
publisherOracle
in interfaceOracleBfile
- Parameters:
position
- the position at which to start reading from the BFILE value that thisBfile
object represents; The first position is 1continueOnErrorSet
- Set of errors which do not cause subsequent operations to be aborted. Not null.- Returns:
- a
Publisher
of the content of thisBFile
- Throws:
java.sql.SQLException
- if a database error occurs or ifposition
is less than 1
-
-