How to store a file in a mysql database using blob

后端 未结 2 1732
名媛妹妹
名媛妹妹 2020-12-18 17:22

I have searched about this matter a lot but, I didn\'t get a proper solution for my problem, I have following method for storing a file using java,

private v         


        
2条回答
  •  天命终不由人
    2020-12-18 17:56

    Try this

    File fBlob = new File ("");
    FileInputStream is = new FileInputStream(fBlob);
    statement.setBinaryStream(1, is, (int) fBlob.length());
    statement.execute();
    

提交回复
热议问题