Recent school decorate a task, involving database to store photos, and read out, according to
This database suddenly how do write picture, not to teach,
Hope to be able to explain in detail,
CodePudding user response:
Binary storage,
CodePudding user response:
FileInputStream fis=new FileInputStream (" D: \ \ liebao \ \ test \ \ '\ \ Auxi PNG ");
Byte [] buff=new byte [fis. Available ()];
Fis. Read (buff);
Blob b=??? ;//need through SQL instantiation here
Try {
B.s etBytes (0, buff);
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
}
Finally, still don't suggest such storage, if the image is too big, database performance will be affected
CodePudding user response:
Base64 is converted into a string
CodePudding user response:
So could you tell me with what method good
CodePudding user response:
The