0

I'm trying to load a file into my db: enter image description here

enter image description here

I've loaded a file and i stored it in a java type 'File'. This is my code:

 String saveStm = String.format("INSERT INTO `Utente` (`idUtente`, `username`, `email`, `name`, `gender`,`secondName`,  `greenPassCode`,`numFollower`, `numFollowing`, `profileImg` ) VALUES ('%d', '%s', '%s', '%s','%s' , '%s','%s', 0 , 0 , LOAD_FILE('%s') );", id, username, email,name,  gender, surname, greenPassCode,profileImg.getAbsolutePath());
   

But everytime i got null on Blob. I don't get any exception. The file il loaded properly, if i print its absolute path that's right. Can somebody help me?

  • Mysql manual for load_file() describes under what circumstances load_file() returns null value. Have you checked the documentation? – Shadow Feb 03 '22 at 14:35

0 Answers0