Thanks for your reply.

Use database to restore file is the requrement of our project ,So I must 
find the way of problem.
As you said ,I trust the problem is beacuse of mysql protocol that is the 
filed must be send as a single packet. I have same test in postgresql ,In 
postgresql the blob type is big object,with the same paramete (16 megs 
stack size)of jvm ,I can send 50 megs file to database! 
I think the mysql may be improve on this point.



>From: "Mark Matthews" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>CC: <[EMAIL PROTECTED]>
>Subject: RE: Faliue: Write huge binary data to blob Field of mysql use 
jdbc
>Date: Fri, 21 Sep 2001 08:14:45 -0500
>
>Hi, I'm the author of the JDBC driver. I'm not sure what the problem is, 
but
>I am going to try and talk you out of storing multi-megabytes as blobs.
>Here's why....In most cases it is more overhead than it is worth. If 
you're
>going to be serving the data from these blobs from some other type of 
server
>(HTTP/NFS, etc), then you've more than doubled your overhead with the
>over-the-wire costs.  RDBMS systems are not optimized for storing and
>retrieving large binary data, filesystems are.
>
>What you probably want to do is generate some unique identifier for the 
file
>and store it on a filesystem that the software you are writing has access
>to. Use MySQL to store metadata about these files (their identifier, 
author,
>revision history, etc), and then use standard ways of providing the file
>(http/nfs/smb, etc). You will find this much more performant.
>
>If you still want to store large files in BLOBs, I would look at 
increasing
>your JVM heap size (by default it's around 16megs, the VM won't allocate
>more memory than that), using the -Xmx switch (see your JDK 
documentation).
>Because of the way the MySQL protocol works, the entire BLOB must be 
created
>in memory as a single packet to be sent to the server, so the driver needs
>at least the amount of memory as the size of your BLOB, plus some overhead
>for escaping binary characters, plus overhead for the driver itself.
>
>
>
>     -Mark
>
> > > We are making a project about "document manage " ,I use
>
> > > org.gjt.mm.mysql
>
> > > as jdbc to communicate with mysql. I can succeed in writing
>
> > > the binary data
>
> > > (the size about 14M) to database ,but when I write the binary
>
> > > data that's
>
> > > size exceed 20M I get a Exception. Please help me! Thanks!
>
>
>


_________________________________________________________________
您可以在 MSN Hotmail 站点 http://www.hotmail.com/cn 免费收发电子邮件


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to