4 messages in com.mysql.lists.javaHelp with blobs| From | Sent On | Attachments |
|---|---|---|
| Jean Carrive | 22 Feb 2001 03:00 | |
| Dirk Hillbrecht | 22 Feb 2001 06:48 | |
| Ian R. Nandhra | 22 Feb 2001 09:17 | |
| Dane Foster | 22 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 ???
Thanks a lot... Jean Carrive
-- Jean Carrive - mailto:jcar...@ina.fr Direction de la Recherche - Institut National de l'Audiovisuel 4 av de l'Europe - 94366 Bry sur Marne Cedex - France Tel: (331) 49 83 34 29 - Fax: (331) 49 83 25 82




