【发布时间】:2015-04-22 09:07:05
【问题描述】:
我有一个 Java 应用程序,可以在从供应商处收到库存商品时插入它们。我捕获产品的条形码图像以及其他信息(名称、价格等..)。我在 PostgreSQL 数据库中保存了 bytea 的条形码图像信息。由于我还没有条形码扫描仪,所以我正在拍摄条形码图像并插入如下。
//code extract
File imgFile = new File(barcodeImage.jpg);
FileInputStream fin=new FileInputStream(imgFile);
pstmt2.setBinaryStream(19, fin, (int) imgFile.length()); //inserts into barcodeImage - bytea column
我现在想使用我保存的条形码图像从数据库中检索产品。类似:
select * from stock_item where barcodeImage=***
如何使用barcodeImage(bytea) 列过滤数据?就像条形码扫描仪的工作原理一样。
【问题讨论】:
标签: java postgresql barcode bytea