List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:April 9 1999 6:42pm
Subject:Re: SELECT with LONGBLOBS
View as plain text  
Josep Curto wrote:
> 
> Hi,
> 
> I have a table with this definition:
> 
> ( int ID_Objecte, longblob Imatge )
> 
> I use JDBC to INSERT rows to this table with a JAVA program, and all works
> fine. the FIELD "Imatge" contents a JPG File.
> 
> The problem is with "SELECT" queries. I want to select individual Rows with
> a SQL String Like:
> 
> SELECT * FROM imatges WHERE id_objecte=5
> 
> If the row I want to select has a longblob field with 65000bytes or less,
> all works fine, and I can
> read the longblob field "Imatge" to visualize the JPG file.
> If the row is 70000bytes, for example (or more), I get an empty set with 0
> rows selected without any error.
> With MYSQLMANAGER I get the same problem.
> 
> I've tried to change parameters to MYSQLD incrementing the buffers but I
> didn't resolve my problem. Actually , I start MYSQLD with:
> 
> mysqld -O max_allowed_packet=900000 -O thread_stack=300000 --big-tables -O
> join_buffer=300000
> 
> I think only max_allowed_packet option afects me, because with a small
> value, I can't do INSERTs with LONGBLOB FIELDS
> 
> Any sugestion?
> 
> thanks,
> 
> -----------------------------
> Josep Curto

Hi Josep

For getting fields larger than 64KBytes via JDBC you have to use the 'Statement' method
'setMaxFieldSize( int sizeInBytes )' before sending the query.

For retrieving fields larger than 64KBytes via another mysql client, you have to increase
the max_allowed_packet size on the client side too!

Tschau
Christian

Thread
SELECT with LONGBLOBSJosep Curto7 Apr
  • Re: SELECT with LONGBLOBSChristian Mack9 Apr