saving a file
try
{
BufferedWriter out = new BufferedWriter(new FileWriter(path+name));
out.write(contents);
out.close();
}
catch (IOException e)
{
e.printStackTrace();
System.out.println("File write error.");
}
SQL code probably would look something like
INSERT INTO table_name VALUES(... match however your table is set up ...);
that, after establishing a connection.