[英]how to create a path to a picture taken from a database and saved a folder?
I'm trying to grab an image from a database in postgresql using java and I would like to know how to create a named route for that image (example C: /images/pic.png) ,this is how I take the image from the database. 我正在尝试使用java从Postgresql中的数据库中获取图像,我想知道如何为该图像创建命名路由(例如C:/images/pic.png),这就是我从中获取图像的方式数据库。
InputStream is;
ImageIcon foto;
is = results.getBinaryStream(i+1);
BufferedImage bi = ImageIO.read(is);
foto = new ImageIcon(bi);
Image img = foto.getImage();
Image newimg = img.getScaledInstance(140, 170, java.awt.Image.SCALE_SMOOTH);
ImageIcon newicon = new ImageIcon(newimg);
Thanks. 谢谢。
How does the images / pictures saved to the database? 图像/图片如何保存到数据库? are you using another script for that?
您是否为此使用其他脚本? or are you manually saving it?
还是您手动保存它? I suggest that you should dedicate another column just for the
path
or location
so that you could just refer to it in the future. 我建议您将另一列专门用于
path
或location
以便将来可以引用它。 Whenever you upload / save the photo, include the information you need in that column. 每当您上传/保存照片时,请在该列中包含所需的信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.