I have a whole Spring project. In general, the database (MySQL) does not want to write Russian letters (the problem is in the classes and methods) and display the Russian text on the pages. How to fix?

P, S, Maven is configured for UTF-8.

  • one
    Try constructing strings like this: new String (bytearray, "UTF-8"); - Stranger in the Q
  • one
    There are too many places where something can go wrong. For example, how do you connect to the database, with what settings? - Slava Semushin
  • Maven is just a collector. It is necessary to look at what encoding is meant when connecting to a database, in what encoding the database tables themselves, in what encoding data was transferred to this table (I remember a fun time when I got the tables in cp1251 full lines in utf8, it happened and vice versa), in what encoding are transferred the page with the forms (web interface), in which encoding the script sends the strings from the client side (or just the form) towards the service. - DimXenon
  • Connecting via hibernate: <session-factory> <property name = "hibernate.dialect"> org.hibernate.dialect.MySQL5Dialect </ property> <property name = "hibernate.connection.driver_class"> com.mysql.jdbc.Driver < / property> <property name = "hibernate.connection.url"> jdbc: mysql: // localhost: 3306 / table </ property> <property name = "hibernate.connection.username"> root </ property> <property name = "connection.password"> root </ property> - Loligan

0