データベースにいくつかの画像を保存しましたが、取得する際には177x122にサイズを変更します。どのように私はJAVAでそれを行うことができますか? ここでは、データベースからイメージを取得するために使用したコードがありますが、177x122のイメージを取得するためにはどのような変更を行う必要があります。データベースから異なるサイズの画像を取得する
PreparedStatement pstm1 = con.prepareStatement("select * from image");
ResultSet rs1 = pstm1.executeQuery();
while(rs1.next()) {
InputStream fis1;
FileOutputStream fos;
String image_id;
try {
fis1 = rs1.getBinaryStream("image");
image_id=rs1.getString("image_id");
fos = new FileOutputStream(new File("images" + (image_id) + ".jpg"));
int c;
while ((c = fis1.read()) != -1) {
fos.write(c);
}
fis1.close();
fos.close();
JOptionPane.showMessageDialog(null, "Image Successfully Retrieved");
} catch (Exception ex) {
System.out.println(ex);
}
}