dbTalk Databases Forums  

DataTrunctation error when BLOB/CLOB greater than 64K

mailing.database.mysql-java mailing.database.mysql-java


Discuss DataTrunctation error when BLOB/CLOB greater than 64K in the mailing.database.mysql-java forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert DiFalco
 
Posts: n/a

Default DataTrunctation error when BLOB/CLOB greater than 64K - 02-24-2006 , 12:16 PM






Is there a way to lift the restriction on how much data can be written
to a LOB in MySQL from JDBC?

R.


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=3D...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Robert DiFalco
 
Posts: n/a

Default RE: DataTrunctation error when BLOB/CLOB greater than 64K - 02-24-2006 , 12:51 PM






Scratch that, I'm stupid. It's a limitation on the size of MySQL LOBs.
Need to move to MEDIUM or LONG.=20

-----Original Message-----
From: Robert DiFalco [mailto:rdifalco (AT) tripwire (DOT) com]=20
Sent: Friday, February 24, 2006 10:16 AM
To: java (AT) lists (DOT) mysql.com
Subject: DataTrunctation error when BLOB/CLOB greater than 64K

Is there a way to lift the restriction on how much data can be written
to a LOB in MySQL from JDBC?

R.


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:
http://lists.mysql.com/java?unsub=3D...wire (DOT) com




--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=3D...ie.nctu.edu.tw


Reply With Quote
  #3  
Old   
Bill Karwin
 
Posts: n/a

Default Re: DataTrunctation error when BLOB/CLOB greater than 64K - 02-24-2006 , 12:54 PM



""Robert DiFalco"" <rdifalco (AT) tripwire (DOT) com> wrote

Quote:
Is there a way to lift the restriction on how much data can be written
to a LOB in MySQL from JDBC?
Regardless of JDBC, 64KB is the size limit on the plain BLOB datatype in
MySQL. You can declare the field in the database as a MEDIUMBLOB or
LONGBLOB if you need longer data.

See http://dev.mysql.com/doc/refman/5.0/...-overview.html for
details on the maximum size of respective BLOB types.

Alternately, in MySQL 4.1 and later, you can specify a length argument to
the BLOB type keyword, and it will promote the field to the BLOB type that
can store that length of data.
For example:

CREATE TABLE mytable (
...
myLongBlobField BLOB(120000),
...
);

The field will be created as a MEDIUMBLOB, since 120KB is too large to fit
in a plain BLOB. A subsequent "SHOW CREATE TABLE mytable" statement shows
the field to be of type MEDIUMBLOB.

Regards,
Bill K.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.