Blob and Clob together are known as LOB(Large Object Type). The following are the major differences between Blob and Clob data types.
Blob | Clob |
---|---|
The full form of Blob is a Binary Large Object. | The full form of Clob is Character Large Object. |
This is used to store large binary data. | This is used to store large textual data. |
This stores values in the form of binary streams. | This stores values in the form of character streams. |
Using this you can stores files like videos, images, gifs, and audio files. | Using this you can store files like text files, PDF documents, word documents etc. |
MySQL supports this with the following datatypes:
| MySQL supports this with the following datatypes:
|
In JDBC API it is represented by java.sql.Blob Interface. | In JDBC it is represented by java.sql.Clob Interface. |
The Blob object in JDBC points to the location of BLOB instead of holding its binary data. | The Blob object in JDBC points to the location of BLOB instead of holding its character data. |
To store Blob JDBC (PreparedStatement) provides methods like:
| To store Clob JDBC (PreparedStatement) provides methods like:
|
And to retrieve (ResultSet) Blob it provides methods like:
| And to retrieve (ResultSet) Clob it provides methods like:
|