This is probably a very easy question but its driveing me mad. I am doing a project in which part of it is that first year csse student will submit their java exams online. The problem is I can't figure out how to output a file to a mysql database. I am selecting the file from a jfilechooser and I will be outputting the student id, timestamp and the file to the database. I'm using java. I just need to figure out how to output the .java file to the database. If any one can help I would be very grateful.