Skip to content
Advertisement

Can’t insert Cyrillic symbols into MySQL with JDBC

I have a web app which uses com.mysql.jdbc.Driver to connect to MySQL database. Here are jdbcMySQL.properties:

I create database like this:

And the problem is: if I make

then I have in my table

BUT, if I make:

I have in my table:

Advertisement

Answer

MySQL is a bit crazy w.r.t. encodings, try:

Furthermore there is one more possible error cause: check that the editor encoding is the same as the javac compiler encoding. If they differ you see something different than what is compiled.

You could try the u-escaped version to test that, or look in the project settings:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement