Domanda di colloquio di Bank of America

Basic Java question. Dependecy injection in spring boot. How do you convert the date to object and vice versa while storing in the database.