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