Dear administrator,
 Now I have a quesion and want to get your help.

When I insert an image file data (data size > 64KB) to a BLOB field of MySQL database 
by com.mysql.jdbc.driber,there is error. Error message as follows:
"aq.executeQuery:Communication link failure:comm.mysql.jdbc.packetTooBigException"

The part of  my program as follows:
..............

FileInputStream fis = new FileInputStream("untitl2.gif");

......................
            conn = 
DriverManager.getConnection("jdbc:mysql://dbgserver.ihep.ac.cn/bsrf?user=bsrf&password=bsrf&useUnicode=true&characterEncoding=Gb2312");
             String ins ="insert into myimg values(?,?)";
             PreparedStatement stmt = conn.prepareStatement(ins);
             System.out.println("Test1*****");
             stmt.setInt(1,1001);
             try 
              {
                int len= fis.available(); 
                System.out.println(len);
                                stmt.setBinaryStream(2,fis,len);
                System.out.println("Test*******2*");
                        int rowsupdated = stmt.executeUpdate();  // When program run 
in here , it appears error.
                        System.out.println("Test3*****");
                                System.out.println("RowsUpdated= "+rowsupdated);
           
                     }
             catch(IOException ex) { 
System.out.println("IOException:"+ex.getMessage());}

 Could you help to relve this quesion as soon as.  Thank you very much.

 I am looking forward ro hearing from you.


                             Best Regards,
                                 
                            Ma Mei


-----------------------------------------------
Ma Mei
Computing Center 
Institute of High Energy Physics
P.O.Box 918 Ext.7
Beijing 100039
P.R. China
Phone: (8610) 88235037
FAX: (8610) 88236839
E-Mail: [EMAIL PROTECTED]
-------------------------------------------------


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to