Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我想在不使用流的情况下在模型窗口中显示的图像Url_Java_Spring_Jakarta Ee - Fatal编程技术网

Java 我想在不使用流的情况下在模型窗口中显示的图像Url

Java 我想在不使用流的情况下在模型窗口中显示的图像Url,java,spring,jakarta-ee,Java,Spring,Jakarta Ee,我有一个图像Url,我从数据库中得到,我想在一个模型窗口中显示相应的图像,而不使用流,我怎么能做到这一点 Query query = sessionFactory.getCurrentSession().createQuery("FROM RecordingInfo where recordingId =? " ); List<RecordingInfo> recordingInfo = query.setInteger(0, recordingId).list()

我有一个图像Url,我从数据库中得到,我想在一个模型窗口中显示相应的图像,而不使用流,我怎么能做到这一点

 Query query = sessionFactory.getCurrentSession().createQuery("FROM RecordingInfo where recordingId =? " );
        List<RecordingInfo> recordingInfo = query.setInteger(0, recordingId).list();
Query Query=sessionFactory.getCurrentSession().createQuery(“来自RecordingInfo,其中recordingId=?”);
List recordingInfo=query.setInteger(0,recordingId.List();
这里是来自db的url

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

这是我想显示为一个图像,但我不应该使用流


非常感谢您的帮助:)

您不需要流,因为图像本身不保存在数据库中,只保存图像的路径

您只需执行下面的伪代码

Model.setImage (ImageIO.read(new FIle("<the image path from database>")))
Model.setImage(ImageIO.read(新文件(“”))