Hi,
I wonder if any one might be able to help, i am trying to insert a .jpg into a mySQL data base, so far i have tried inserting the file as byte[], i keep on recieveing an error message, stating that the syntax i have used is incorrect,
is nay one able to help me? i have provided a copy of the create table SQL used as well,

Thanks in advance.

public void putFile(int FoodID, File infile){
try{
System.out.println(infile.getName());
FileInputStream is=new FileInputStream(infile);
byte[] b=new byte[(int)infile.length()];
is.read(b);
bt=b;
//is.close();
Statement stmt = con.createStatement();
stmt.executeUpdate("INSERT INTO photo VALUES("+FoodID+",'"+infile.getName()+"',"+bt+")");
stmt.close();
con.commit();
}catch (Exception e){
System.out.println("error: " + e);
}
}


Create Table Photo(
Foodin_id INT NOT NULL,
photoName VARCHAR(150) NOT NULL,
PRIMARY KEY(Foodin_id, photoName),
photo MEDIUMBLOB NOT NULL,
Foreign Key (Foodin_id)
References Food_Inspect(Foodin_id)) TYPE=INNODB;