Writing hebrew to mySql using JAVA

后端 未结 2 1008
春和景丽
春和景丽 2021-01-17 01:55

I have a small Java method that inserts short messages to a MySQL Database. the table\'s default Collation is utf8_unicode_ci and the java code is:

private v         


        
2条回答
  •  孤城傲影
    2021-01-17 02:11

    Set UTF-8 in your code. See this;

        Connection con = DriverManager.getConnection("jdbc:mysql://localhost/embeddedChat?useUnicode=true&characterEncoding=utf8");
    

提交回复
热议问题