JDBC for MySQL - Herong's Tutorial Examples - v3.13, by Herong Yang
Create Tables with CLOB Columns
This section describes how to create tables with CLOB (LONGTEXT) columns in MySQL server.
MySQL server support CLOB with 4 data types:
In order to test CLOB columns in MySQL server, I used the MySQL command line interface to create a test table with one CLOB column:
herong> mysql -u Herong -pTopSecret mysql> use HerongDB; Database changed mysql> CREATE TABLE Article (ID INTEGER PRIMARY KEY AUTO_INCREMENT, -> Subject VARCHAR(256) NOT NULL, -> Body LONGTEXT); Query OK, 0 rows affected (0.38 sec)
Table of Contents
JDBC (Java Database Connectivity) Introduction
MySQL JDBC Driver (MySQL Connector/J)
MySQL - Reference Implementation of JdbcRowSet
MySQL - JBDC CallableStatement
►MySQL CLOB (Character Large Object) - TEXT
Overview of CLOB (Character Large Object)
►Create Tables with CLOB Columns
Inserting CLOB Values with SQL INSERT Statements
Inserting CLOB Values with setString() Method
Inserting CLOB Values with setCharacterStream() Method
Retrieving CLOB Values with getString() Method
Retrieving CLOB Values with getCharacterStream() Method
Retrieving CLOB Values with getClob() Method
Inserting CLOB Values with setClob() Method
MySQL BLOB (Binary Large Object) - BLOB