1.

How Do I Insert An Image File (or Other Raw Data) Into A Database?

Answer»

All raw data types (including binary DOCUMENTS or IMAGES) should be READ and uploaded to the database as an array of bytes, byte[]. Originating from a binary file,

  1. Read all data from the file using a FILEINPUTSTREAM.
  2. Create a byte array from the read data.
  3. USE method setBytes(int index, byte[] data); of java.sql.PreparedStatement to upload the data.

All raw data types (including binary documents or images) should be read and uploaded to the database as an array of bytes, byte[]. Originating from a binary file,



Discussion

No Comment Found