Configure MYSQL to use UTF8 with Spring/Hibernate

I started using MySQL in a project that i started working on,
The project uses Hibernate and Spring
and the problem was that strings end up as question marks in the database

adding the following lines in hibernate.cfg.xml


utf8

true

did not work!

The problem was solved when i added
"?useUnicode=true&characterEncoding=utf-8"
to the connection URL in the application context file

see block: