方案是我在服务器上安装了Oracle数据库,我在C#.NET中创建了一个Web服务并将数据传输到MySQL。
当我执行Web服务时,它会在Web浏览器上正确显示数据。
[[{"'N'":"N","ILOM_SEQUENCE":32543,"LG_NUMBER":7595013,"LG_STATUS":"N","LG_AMT":500.0,"CUST_S_NAME":"سيف بن حمد بن عبدالله السليماني للتجارة","LG_DATE_FROM":"2015-08-19T00:00:00","LG_DATE_TO":"2015-08-21T00:00:00"}]]
上面你可以看到我在试图在mySQL中保存数据时的响应所有阿拉伯数据都是??????
当我打印查询时,它显示正确的数据
CALL updateWebLog('pro_raffd_lg_prc', '[[{"N":"N","ILOM_SEQUENCE":32543,"LG_NUMBER":7595013,"LG_STATUS":"N","LG_AMT":500.0,"CUST_S_NAME":"سيف بن حمد بن عبدالله السليماني للتجارة","LG_DATE_FROM":"2015-08-19T00:00:00","LG_DATE_TO":"2015-08-21T00:00:00"}]]
在数据库中插入json后,所有阿拉伯语都消失了
[[{"N":"N","ILOM_SEQUENCE":32543,"LG_NUMBER":7595013,"LG_STATUS":"N","LG_AMT":500.0,"CUST_S_NAME":"??? ?? ??? ?? ??????? ????????? ???????","LG_DATE_FROM":"2015-08-19T00:00:00","LG_DATE_TO":"2015-08-21T00:00:00"}]]
C#
mConnection.Open();
mCommand = mConnection.CreateCommand();
mCommand.CommandText = "CALL updateWebLog('" + type + "','" + xmlData + "');";
mCommand.Connection = mConnection;
mCommand.ExecuteNonQuery();
mConnection.Close();