データベースからのブロブに基づいて JSON を作成する必要があります。ブロブ画像を取得するには、以下のコードを使用し、json 配列で表示した後に:
Statement s = connection.createStatement();
ResultSet r = s.executeQuery("select image from images");
while (r.next()) {
JSONObject obj = new JSONObject();
obj.put("img", r.getBlob("image"));
}
画像ブロブに従って、各画像の JSON オブジェクトを返したいと思います。どうすれば達成できますか?