Good afternoon, I connect to the database in this way:

private static final String url = "jdbc:mysql://172.0.0.1/klon"; private static final String user = "root"; private static final String password = "root"; 

There was a question of how to set the UTF-8 encoding immediately upon connection, that is, to say MySQL that the data will come in Russian?

    1 answer 1

    The encoding is set in the URL: jdbc:mysql://172.0.0.1/klon?characterEncoding=utf8