File file = new File("filename");
FileInputStream fis = new FileInputStream(file);
len = (int)file.length();
//prepared stmt
st.setBinaryStream(1, fis, len);
I have uploaded the file into mysql database from servlet program.
But how to read that file or tell me how to upload a doc into the database.