![]() |
JDBC Reference
|
Reference Manual |
java.sql.Blob and java.sql.ClobIn JDBC 2.0, java.sql.Blob is the mapping for the SQL BLOB (Binary Large Object) type; java.sql.Clob is the mapping for the SQL CLOB (Character Large Object) type. CLOBs and BLOBS provide a logical pointer to the large objects rather than to the object itself. Cloudscape materializes only one page into memory at a time. Although Cloudscape does not support the built-in BLOB or CLOB data types, it does provide some support for them in the following ways:
Cloudscape implements all of the methods for these JDBC 2.0 interfaces except for the set and get methods in CallableStatement. As per the JDBC specification, the lifespan of a Clob or Blob ends when the transaction commits. For that reason, it is a good idea to turn off auto-commit with these features. NotesThe usual Cloudscape locking mechanisms (shared locks) prevent other transactions from updating or deleting the database item to which the java.sql.Blob or java.sql.Clob object is a pointer. However, in some cases, Cloudscape's instantaneous lock mechanisms could allow a period of time in which the column underlying the Blob or Clob is unprotected. A subsequent call to getBlob/getClob, or to a Blob/Clob method, could cause undefined behavior. Therefore, it is advisable to turn off instantaneous locking by setting the property bulkFetch to 1. (This problem also exists for the getXXXStream methods.) For example:
SELECT BlobColumn Furthermore, there is nothing to prevent the transaction that holds the Blob/Clob (as opposed to another transaction) from updating the underlying row. (The same problem exists with the getXXXStream methods.) Program applications to prevent updates to the underlying object while a Blob/Clob is open on it; failing to do this could result in undefined behavior. Do not call more than one of the ResultSet getXXX methods on the same column if one of the methods is one of the following: These methods share the same underlying stream; calling one more than one of these methods on the same column so could result in undefined behavior. For example: ResultSet rs = s.executeQuery("SELECT text FROM CLOBS WHERE i = 1"); while (rs.next()) { aclob=rs.getClob(1); ip = rs.getAsciiStream(1); } The streams that handle long-columns are not thread safe. This means that if a user chooses to open multiple threads and access the stream from each thread, the resulting behavior is undefined. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |