Greetings The situation is this - there is a Oracle DB, there is a Worker table in it, a photo of workers in it in BLOB format. It is not necessary to display in Vaadin Grid along with the rest of the data.

How it works now: in the @Entity for Worker class, the foto field is pulled out as byte [], you have to save it from the hard disk separately, and slip the new ThemeResource (PATH) into the ImageRenderer () in the grid.

Is it possible to directly transfer the picture without saving to the hard disk?

    2 answers 2

    // Create the stream resource with some initial filename StreamResource imageResource = new StreamResource(imageSource, "initial-filename.png"); // Instruct browser not to cache the image imageResource.setCacheTime(0); // Display the image Image image = new Image(null, imageResource); 

    Learn more about Resources and StreamResources in Vaadin.

      The best solution would be to transfer pictures from the database to the front-end server and save only links in the database.

      Threat Storage of graphic data in the blob fields - something else is a perversion)) Sorry if it did not help.

      • Now it works like this :) - Pavel
      • The problem is - there are several third-party databases, and there is a Vaadin application that connects to them. For display, you have to save them to disk on the go, then display them. Keep them does not make sense. - Pavel
      • I don’t know Vaadin, but at a low level it’s easier then not to save to disk, but to ramp up such img to an applet (to the filter) and return to request. At least save time working with the disk. I think that Vorh suggested this)) - Tachkin