Created method to save trainer's and book details in the database