Return image from MySQL database

0

Currently I am trying to return an image from a database. Using java, I tried this command:

pi.setImagem((File) rs.getBlob("imagem"));

The variable that will receive the image is as "File", and in the database it is "BLOB". It was passed to us that we can only use HTML, CSS, JavaScript, JSP and Servlet.

The error I'm getting is this:

  

com.mysql.jdbc.Blob can not be cast to java.io.File

    
asked by anonymous 14.05.2018 / 16:09

0 answers