All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.sql.BFILE

oracle.sql.BFILE

public class BFILE
This class will implements the java.sql.Bfile interface in JDBC 2.0 It provides the native implementation of the Bfile methods.


Method Index

 o asciiStreamValue()
Convert to an ascii stream representation of the datum object
 o closeFile()
Close the FILE.
 o fileExists()
Find out if a given BFILE (whose locator) points to a file that actually exists on the server's filesystem.
 o getBinaryStream()
Retrieve the entire BFILE as a stream.
 o getBytes(long, int)
Return a copy of the contents of the BFILE at the requested position.
 o getBytes(long, int, byte[])
Copy the contents of the BFILE at the requested position to suppied buffer.
 o getConnection()
Get connection object.
 o getDirAlias()
Gets the Bfile's directory alias.
 o getName()
Gets the Bfile's file name.
 o isConvertibleTo(Class)
Test whether this data object can be converted to the specified Java data type.
 o isFileOpen()
Find out whether a BFILE was opened with the give BFILE.
 o length()
The length of the BFILE in bytes.
 o openFile()
Open the FILE.
 o position(BFILE, long)
Determine the byte position at which the given pattern
 o position(byte[], long)
Determine the byte position at which the given byte pattern
 o toJdbc()
Convert this data object into its default Java object type.

Methods

 o length
 public long length() throws SQLException
The length of the BFILE in bytes.

Returns:
length of the BFILE in bytes
 o getBytes
 public byte[] getBytes(long pos,
                        int length) throws SQLException
Return a copy of the contents of the BFILE at the requested position.

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

Parameters:
pos - is the first byte of the bfile to be extracted.
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
 o getBinaryStream
 public InputStream getBinaryStream() throws SQLException
Retrieve the entire BFILE as a stream.

Returns:
a stream containing the BFILE data
 o position
 public long position(byte pattern[],
                      long start) throws SQLException
Determine the byte position at which the given byte pattern

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

Parameters:
searchstr - is the pattern to search for.
start - is the position at which to begin searching.
Returns:
the position at which the pattern appears, else -1.
 o getName
 public String getName() throws SQLException
Gets the Bfile's file name.

Parameters:
bfile - The Bfile for which to get the file name.
Returns:
The file name.
 o getDirAlias
 public String getDirAlias() throws SQLException
Gets the Bfile's directory alias.

Parameters:
bfile - The Bfile for which to get the directory alias.
Returns:
The directory alias name.
 o openFile
 public void openFile() throws SQLException
Open the FILE.

Parameters:
bfile - The BFILE object to be opened.
 o isFileOpen
 public boolean isFileOpen() throws SQLException
Find out whether a BFILE was opened with the give BFILE.

Parameters:
bfile - The Bfile to be tested.
Returns:
true if the BFILE was opened, false if it was not opened.
 o fileExists
 public boolean fileExists() throws SQLException
Find out if a given BFILE (whose locator) points to a file that actually exists on the server's filesystem.

Parameters:
bfile - The Bfile to be tested.
Returns:
true if the physical file exists, false if it does not exist.
 o closeFile
 public void closeFile() throws SQLException
Close the FILE.

Parameters:
bfile - The Bfile to be closed.
 o getConnection
 public OracleConnection getConnection() throws SQLException
Get connection object.

 o toJdbc
 public Object toJdbc() throws SQLException
Convert this data object into its default Java object type.

Returns:
this object.
Throws: SQLException
if any of the lower layer code throws an exception.
 o isConvertibleTo
 public boolean isConvertibleTo(Class jClass)
Test whether this data object can be converted to the specified Java data type.

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.
 o asciiStreamValue
 public InputStream asciiStreamValue() throws SQLException
Convert to an ascii stream representation of the datum object

Returns:
ascii stream representation of the datum object
Throws: SQLException,
if no ascii stream representation exists

All Packages  Class Hierarchy  This Package  Previous  Next  Index