繁体   English   中英

如何创建从数据库拍摄并保存文件夹的图片的路径?

[英]how to create a path to a picture taken from a database and saved a folder?

我正在尝试使用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);

谢谢。

图像/图片如何保存到数据库? 您是否为此使用其他脚本? 还是您手动保存它? 我建议您将另一列专门用于pathlocation以便将来可以引用它。 每当您上传/保存照片时,请在该列中包含所需的信息。

这个答案也可能对您有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM