0

This is my btnCapture ActionPerformed:

FileDialog fd = new FileDialog(cam.this, "Save Image", FileDialog.SAVE);
fd.show();
if (fd.getFile() != null) {
  fn = fd.getDirectory() + fd.getFile() + ".jpg";
  try {
   Imgcodecs.imwrite(fn, frame);
  } catch (Exception ex) {}
}
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Storing a image into a database is not the best practice try storing the image in a location and store the path of image in database. – bit-shashank Oct 21 '17 at 14:39
  • mysql offers a blob data type that can be used to store binary information. if you use jdbc to access the database, you just pass InputStream with the save image, and use the OutputStream to read. but keep in mind that it is not very desirable to keep the images in the database (although there are some advantages) – mr mcwolf Oct 22 '17 at 06:19
  • will you show me how to do it? @javafan – Kurt Ruzell Oct 22 '17 at 11:30

0 Answers0