As new technologies are evolving, the importance of large data storage is growing. The storage requirements of applications are also on an upward trend because the requirement to represent real life situations in databases has resulted in the need for Large object data types.

Multimedia entities like images, video, and audio clips were rarely used outside of specialty software. Today, many Web-based applications require their databases to manage such data. Other software's need to store bulk data concerned with routine diagrams, maps, or business models. In order to cater these needs, Daffodil DB supports the concept of large object data types. The large object data types are

* Character Large Objects (CLOB): A character string comprising of single-byte characters with an allied code page. This data type is best suited for storing text-oriented information where the size of data could grow beyond the limits of a regular VARCHAR data type.

* Binary Large Objects (BLOB): A BLOB is a binary large object that can hold a variable amount of data. This data type may be the most useful because it can store binary data, making it a perfect source type for use by User-defined Distinct Types. Blob columns can be used to store image, voice, graphical, and other types of business or application specific data.

An external location in the database stores all large object values outside their records in the table. There is a large object descriptor for each large object in each row of a table. The large object descriptor contains control information used to access the large object data stored elsewhere on disk. It is the storing of large object data outside their records that allows large objects to store up to 2 GB in size. Accessing the large object descriptor causes a small amount of overhead when manipulating large objects.

The maximum size for each large object column is part of the declaration of the large object type in the CREATE TABLE statement. The maximum size of a large object column determines the maximum size of any large object descriptor in that column. As a result, it also determines how many columns of all data types can fit in a single row.

We have included a comprehensive example on clob usage. For more information, refer to sample. Java file. This file can be downloaded with

The sample code snippets illustrate the usage of object data types in Daffodil DB. These code snippets can be used directly with Daffodil DB sample databases

Sample Code for making a table having a clob column

Statement stt = con.createStatement();
String createTable = "create table clobTable( columnOne clob)";

Code for inserting a file into a clob column

InputStream tempStream = getClass().getResourceAsStream("DaffodilDBReadMe.t xt");
InputStreamReader reader = new InputStreamReader(tempStream);
PreparedStatement ps = con.prepareStatement(
"insert into clobTable values(?)");
for (int i = 0; i < 1; i++) {
ps.setCharacterStream(1, reader, tempStream.available());
// ps.setAsciiStream(1, tempStream, tempStream.available());

Code for retrieving data from a clob column

ResultSet rs = stt.executeQuery("select * from clobTable");
while ( {
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
Clob clob = rs.getClob(i);
Reader read = clob.getCharacterStream();
String text = null;
if (read != null) {
CharArrayWriter writer = new CharArrayWriter();
char[] buf = new char[1024];
int count =, 0, buf.length);
while (count > 0) {
writer.write(buf, 0, count );
count =, 0, buf.length);
text = new String(writer.toCharArray());
else {
System.out.println("Stream is null");
return ;

For more information and support regarding any issue related to Daffodil DB Contact us at

Join other professional developers in Daffodil DB support forums at