You may add files to the database if it supports BLOB types. The code snippet below adds a file with its name into a table called testImage.

Java Code:
File f = new File(fName);
FileInputStream in = new FileInputStream(f);
byte[] image = new byte[(int) f.length()];;
String sql = "INSERT INTO testImage VALUES(?,?)";
PreparedStatement stmt = c.prepareStatement(sql);
stmt.setString(1, name);
stmt.setBytes(2, image);