| Oracle8i Application Developer's Guide - Large Objects (LOBs)  Release 2 (8.1.6) Part Number A76940-01  | 
  | 
LOB Programmatic Environments, 9 of 9
You can make changes to an entire internal LOB, or to pieces of the beginning, middle or end of an internal LOB in Java by means of the JDBC API via the objects:
These objects also implement  java.sql.Blob and java.sql.Clob interfaces according to the JDBC 2.0 specification. With this implementation, an oracle.sql.BLOB can be used wherever a java.sql.Blob is expected and an oracle.sql.CLOB can be used wherever a java.sql.Clob is expected. 
JDBC interface allows you to use Java to read both internal and external LOBs (BFILEs). 
BLOB and CLOB  data types. 
The BLOB, CLOB, and BFILE classes encapsulate LOB locators, so you do not deal with locators but instead use methods and properties provided to perform operations and get state information. 
Any LOB functionality not provided by these classes can be accessed by a call to the PL/SQL DBMS_LOB package. This technique is used repeatedly in the examples throughout this manual. 
You can get a reference to any of the above LOBs in the following two ways:
When BLOB and CLOB objects are retrieved as a part of an OracleResultSet, these objects represent LOB locators of the currently selected row. 
If the current row changes due to a move operation, for example, rset.next(), the retrieved locator still refers to the original LOB row. 
To retrieve the locator for the most current row, you must call getXXXX() on the OracleResultSet each time a move operation is made, where XXXX is a BLOB, CLOB or BFILE.    
| 
See:
 
 
 
  | 
Refer to the following web site for further information about JDBC:
http://www.oracle.com/products
The following JDBC methods operate on BLOBs, CLOBs, and BFILEs:
 oracle.sql.BLOB Methods To Modify BLOB Values:| Method | Description | 
|---|---|
| 
 
  | 
 
Inserts the byte array into the   | 
 oracle.sql.BLOB Methods To Read or Examine BLOB Values
 oracle.sql.BLOB Methods and Properties for BLOB-Buffering| Method | Description | 
|---|---|
| 
 
  | 
 
Streams the   | 
| 
 
  | 
 
Writes to   | 
 oracle.sql.CLOB Methods To Modify CLOB Values  oracle.sql.CLOB Methods To Read or Examine CLOB Values
 oracle.sql.CLOB  Methods and Properties for CLOB-Buffering oracle.sql.BFILE Methods To Read or Examine External LOB (BFILE) Values oracle.sql.BFILE Methods and Properties for BFILE-Buffering| Method | Description | 
|---|---|
| 
 
  | 
 Reads the BFILE as a binary stream  | 
OracleBlob and OracleClob were Oracle specific functions used inJDBC 8.0.x drivers to access LOB data. In 8.1.x and future releases, OracleBlob and OracleClob are deprecated.
If you use OracleBlob or OracleClob to access LOB data, you will receive the following typical error message, for example, when attempting to manipulate LOBs with Oracle8i release 8.1.5 JDBC Thin Driver :
"Dumping lobs java.sql.SQLException: ORA-03115: unsupported network datatype or representation etc."
See release 8.1.5 Oracle8i JDBC Developer's Guide and Reference for a description of these non-supported functions and alternative and improved JDBC methods.
For further ideas on working with LOBs with Java, refer to the LOB Example sample shipped with Oracle8i or get a LOB examplet from www.oracle.com/java/jdbc.
| 
 | 
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved.  | 
 
  |