I am trying to display an image coming from my database in sql developer that has the field BLOB
public class Alojamento {
@RequestMapping(value = "/alojamento")
public ModelAndView test(HttpServletResponse response,
HttpServletRequest request) throws IOException {
List<SpringWebMVC.s2.DAL.FotoAlojamento> FOTOInstance =
SpringWebMVC.s2.BLL.Fotos.readAllFotoAlojamento();
ModelAndView mview = new ModelAndView("alojamento");
mview.addObject("fotoalojamentos", FOTOInstance);
return mview;
}
}
Code in my Controller, this was for me to see what type of value blob field brings
<div class="responsive" th:each="fotoalojamento: ${fotoalojamentos}">
<div class="gallery">
<a target="_blank" href="img_5terre.jpg">
</a>
<div class="desc" th:text="${fotoalojamento.getFotoalo()}"></div>
</div>
</div>
Result:
So, how i can with this value oracle.sql.BLOB@516a6064 convert into an image to display ?