Hi , How can we use Blob and Clob in iBATIS OR Mapping.
posted 10 years ago
My personal feeling is that if the data type is BLOB or CLOB, it's probably too big to be keeping around in memory anyway. In general, with these types, you want to either stream them directly to the browser, or stream them to a file on disk (good for caching) and then let the browser download the file directly. Those are the appproaches I recommend, and for those, you should use straight JDBC (not iBATIS, Hibernate or any other tool).
With that little disclaimer out of the way....
In some cases, it makes sense to map small BLOBs (avatar images) and CLOBs (text that blows the 255 or 65k char limit of some DBs). CLOB is the most common case, and iBATIS can do that simply by specifying a StringJava type and a CLOB or LONGVARCHAR JDBC type. For BLOB, you must map a Java property of type byte (byte array) to a JDBC type of BLOB or LONGVARBINARY.
I recommend using iBATIS 2.3.
Note to Oracle users: for BLOB and CLOB you must use Oracle 10g drivers, as previous to that version they did not support the standard JDBC *LOB interface. The 10g drivers can be used with older Oracle databases, or at least with 9i.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads