com.ibm.as400.access
Class AS400JDBCBlobLocator

java.lang.Object
  |
  +--com.ibm.as400.access.AS400JDBCBlobLocator

public class AS400JDBCBlobLocator
extends java.lang.Object
implements java.sql.Blob

The AS400JDBCBlobLocator class provides access to binary large objects. The data is valid only within the current transaction.


Method Summary
 java.io.InputStream getBinaryStream()
          Returns the entire blob as a stream of uninterpreted bytes.
 byte[] getBytes(long start, int length)
          Returns part of the contents of the blob.
 long length()
          Returns the length of the blob.
 long position(java.sql.Blob pattern, long start)
          Returns the position at which a pattern is found in the blob.
 long position(byte[] pattern, long start)
          Returns the position at which a pattern is found in the blob.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws java.sql.SQLException
Returns the entire blob as a stream of uninterpreted bytes.
Specified by:
getBinaryStream in interface java.sql.Blob
Returns:
The stream.
Throws:
java.sql.SQLException - If an error occurs.

getBytes

public byte[] getBytes(long start,
                       int length)
                throws java.sql.SQLException
Returns part of the contents of the blob.
Specified by:
getBytes in interface java.sql.Blob
Parameters:
start - The position within the blob (1-based).
length - The length to return.
Returns:
The contents.
Throws:
java.sql.SQLException - If the position is not valid, if the length is not valid, or an error occurs.

length

public long length()
            throws java.sql.SQLException
Returns the length of the blob.
Specified by:
length in interface java.sql.Blob
Returns:
The length of the blob, in bytes.
Throws:
java.sql.SQLException - If an error occurs.

position

public long position(byte[] pattern,
                     long start)
              throws java.sql.SQLException
Returns the position at which a pattern is found in the blob. This method is not supported.
Specified by:
position in interface java.sql.Blob
Parameters:
pattern - The pattern.
start - The position within the blob to begin searching (1-based).
Returns:
Always -1. This method is not supported.
Throws:
java.sql.SQLException - If the pattern is null, the position is not valid, or an error occurs.

position

public long position(java.sql.Blob pattern,
                     long start)
              throws java.sql.SQLException
Returns the position at which a pattern is found in the blob. This method is not supported.
Specified by:
position in interface java.sql.Blob
Parameters:
pattern - The pattern.
start - The position within the blob to begin searching (1-based).
Returns:
Always -1. This method is not supported.
Throws:
java.sql.SQLException - If the pattern is null, the position is not valid, or an error occurs.