Hi,
I;m using mysql to store images, passed to it using java.

My code works fine however for small images however if I use a large image i get errors.

Here is the error:
Java.lang.IllegalArguamentException: Packet is larger than max_allowd_packet from server configuration of 1048576 bytes.

The code is:

public void loadDrawing(int jobNumber, String jobDescription, File fImage){
try{
if (fImage!=null){
FileInputStream isImage = null;
isImage = new FileInputStream(fImage);
PreparedStatement pst = con.prepareStatement("INSERT INTO drawings VALUES(null,"+jobNumber+",\""+jobDescription+"\",? )");
pst.setBinaryStream(1,isImage,(int)fImage.length() );
pst.executeUpdate();
}
}
catch (Exception E) {
System.err.println("Error setting image");
E.printStackTrace();
}
}
Any ideas how i can fix this?

thanks in advance,

steve