linux下Java程式插入DB資料中文亂碼問題,javadb

來源:互聯網
上載者:User

linux下Java程式插入DB資料中文亂碼問題,javadb

首先,插入到DB的資料,在Linux下查詢的時候,欄位顯示為??。


再次,在windows串連到db上,查看的結果並不是亂碼。



修改Eclipse軟體中的編碼:如:windows菜單-》preference-》general-》content type,Javaclassfile和text都設成utf-8;

然後

在Linux下執行以下的命令:

mysql> set names UTF8;

最後,在查詢的時候,Linux下的內容,就不是亂碼了。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.