Write a method to save the settings in the database.