문제

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 :)

도움이 되었습니까?

해결책

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>")))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top