You're making a conceptual mistake here. In HTML, images are to be represented by <img> element with a src attribute which should point to the image's URL. This is in JSF represented by the <h:graphicImage> component whose value attribute will render the src attribute. It expects a String which in turn represents the image's URL. It does not expect some blob, nor a byte array.
You basically need a servlet here. You should let the image's URL point to that servlet along with the image identifier as request parameter or pathinfo and let the servlet stream the image's content from the DB to the response.
E.g.
<h:dataTable value="#{bean.images}" var="image"> <h:column><h:graphicImage value="images/#{image.id}" /></h:column> </h:dataTable> where the #{image.id} returns the unique image identifier. In a servlet which is mapped on an URL pattern of /images/* you can then get it as follows
String imageId = request.getPathInfo().substring(1); Finally use this identifier to get the content as InputStream from the DB and write it to the OutputStream of the response along a correct set of headers.
###See also: