java - can't insert utf-8 characters in mysql database using crontab to automate the program -


i had asked question before because didn't receive guide, i'm asking again. here's original question: fail insert non-english characters database using crontab run program

i wrote java program reads utf-8 file , insert contents mysql database. can call jar file in terminal , works fine. after used crontab automate running program time english chars , numbers insert db.

my database encoding "utf8-general-ci" , server i'm running program centos 6.3.

i should mention have program functionality similar , works fine.

i have tested many things none of them fixed problem. don't know what's problem.

i'm looking solution or clue continue , solve problem. i'll appreciate help.

edit: mysql version :5.1.69

and here 2 images. 1 time run program crontab , other when running program in terminal

enter image description here

enter image description here

i'm not realy expert on here goes nothing. think related what's documented in http://dev.mysql.com/doc/refman/5.6/en/alter-table.html

is default character set on latin1 or ? perhaps left default , think uses latin1.

in case think have this:

alter table target_table_name modify latin1_text_col text character set utf8; alter table target_table_name modify latin1_varchar_col varchar(m) character set utf8; 

you can find out default char set of database doing:

use db_name; show variables "character_set_database"; show variables "collation_database"; 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -