This is SQL query to add a table to your DB which can store a photo.
create table if not exists testphoto( id bigint auto_increment primary key, file_name varchar(255), content_type varchar(255), data binary );