0

My question is about related to MySQL database.

Can any one help me to store a non English string from java application to MySQL database?

I tried in several ways. I changed the collisions of the database columns too. But when passed a non English string to the MySQL database, it shows a "???" mark in the table. Why is this happening?

When passed a English string, that is working fine. But when sending a non English string from the java application, that stores that non English string as a "?" mark on the database.

Can any one help me to resolve this issue?

  • 1
    Please share the java code.and also the `show create table [table]` statement – Raymond Nijland Nov 01 '17 at 13:51
  • https://stackoverflow.com/a/3275661/984823 to communicate to the database in UTF-8 (Unicode). And the database / table / column must be defined for containing UTF8. https://stackoverflow.com/questions/202205/how-to-make-mysql-handle-utf-8-properly – Joop Eggen Nov 01 '17 at 17:24

2 Answers2

0

yu need t change table collection to utf8_genereal_ci or any of this utf8 collection, also in columt data type to string r long string

  • I have already used the collasions that you have mentioned. But I used varchar as the datatype of the column. So, will datatype "varchar" affect ? – Osanda Rajapakse Nov 01 '17 at 13:59
  • i ve never used as varchar but as string and longstring and spanish character are welcome like this ñ or this á –  Nov 01 '17 at 14:20
  • Ok. I will try and will let you know the progress. Btw, thanks a lot for your big help. – Osanda Rajapakse Nov 03 '17 at 01:58
0

Please use UTF8 or UTF8MB4 as character set of the MySQL and chactersetEncoding as utf8 in case you are using JDBC connection from Java Application.

SQL.RK
  • 157
  • 4