4 messages in com.mysql.lists.javaHelp with blobs
FromSent OnAttachments
Jean Carrive22 Feb 2001 03:00 
Dirk Hillbrecht22 Feb 2001 06:48 
Ian R. Nandhra22 Feb 2001 09:17 
Dane Foster22 Feb 2001 10:46 
Subject:Help with blobs
From:Jean Carrive (jcar@ina.fr)
Date:02/22/2001 03:00:53 AM
List:com.mysql.lists.java

Hello,

I'm trying to store large blobs (<16 Mo due to mysql limitations) from a Java client.

I am using mysql 3.23.25-beta and the JDBC driver mm.mysql.jdbc 2.0.4 by Mark Matthews.

I set the max_allowed_packet to 16M from the server side. Nevertheless, it seems that I'm just able to store data up to something like 64Ko.

Here is a piece of code I use to store a file :

protected synchronized int savelFile(String filename) throws RepositoryException { try { FileInputStream stream = new FileInputStream(filename); Connection con = MyConnection.getConnection(); PreparedStatement pstmt = con.prepareStatement("INSERT INTO datatable VALUES (0, ?)"); pstmt.setBinaryStream(1, stream, 0); pstmt.execute() } catch( etc....

This methods saves the first 64Ko of the file.

Has someone an idea on how I could solve this problem ???