时间:2021-07-01 10:21:17 帮助过:30人阅读
读取bytea:
String query = "SELECT data, LENGTH(data) FROM images WHERE id = 1"; pst = con.prepareStatement(query); ResultSet result = pst.executeQuery(); result.next(); //offset to the first row fos = new FileOutputStream("//home//apple//Pictures//eclipse.png"); int len = result.getInt(2); byte[] buf = result.getBytes("data"); fos.write(buf, 0, len); System.out.println("read image.main() success.");
PostgreSQL java读取bytes字段
标签:eclips rest output manager pre get length data bytes