Question

I have a image Url which i am getting from db i want to display corresponding image in a model window without using Streams how can i do it.

 Query query = sessionFactory.getCurrentSession().createQuery("FROM RecordingInfo where recordingId =? " );
        List<RecordingInfo> recordingInfo = query.setInteger(0, recordingId).list();

Here url from db like

D:\jboss-5.1.0.GA\server\default\deploy\sitewatcher.war\ui\UploadedImages\abc.jpg

this i want to display it as a image but i should not use streams

Thank you very much for your help :)

Was it helpful?

Solution

You don't need streams because the image itself is not saved in the database, just the path of the image is.

You can just do something like the pseudo code below

Model.setImage (ImageIO.read(new FIle("<the image path from database>")))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top