簡體   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