Please Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ma Mei

    #1

    Please Help

    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.executeQuer y:Communication link failure:comm.my sql.jdbc.packet TooBigException "

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

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

    ............... ........
    conn = DriverManager.g etConnection("j dbc:mysql://dbgserver.ihep. ac.cn/bsrf?user=bsrf& password=bsrf&u seUnicode=true& characterEncodi ng=Gb2312");
    String ins ="insert into myimg values(?,?)";
    PreparedStateme nt stmt = conn.prepareSta tement(ins);
    System.out.prin tln("Test1***** ");
    stmt.setInt(1,1 001);
    try
    {
    int len= fis.available() ;
    System.out.prin tln(len);
    stmt.setBinaryS tream(2,fis,len );
    System.out.prin tln("Test****** *2*");
    int rowsupdated = stmt.executeUpd ate(); // When program run in here , it appears error.
    System.out.prin tln("Test3***** ");
    System.out.prin tln("RowsUpdate d= "+rowsupdat ed);

    }
    catch(IOExcepti on ex) { System.out.prin tln("IOExceptio n:"+ex.getMessa ge());}

    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: mam@ihep.ac.cn
    -------------------------------------------------


    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...