This document shows how to insert a picture into a MySQL database table using Java. It defines a table called MyPictures with columns for an ID, name, and photo. It then shows Java code that loads the MySQL driver, connects to a database, prepares an INSERT statement, sets the column values including reading a photo file into a binary stream, executes the statement, and commits the transaction.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
11 views1 page
Insert Picture Into DB
This document shows how to insert a picture into a MySQL database table using Java. It defines a table called MyPictures with columns for an ID, name, and photo. It then shows Java code that loads the MySQL driver, connects to a database, prepares an INSERT statement, sets the column values including reading a photo file into a binary stream, executes the statement, and commits the transaction.