如何通过JavaFX从MYSQL显示阿拉伯语查询? [英] How can I show arabic query search from MYSQL by JavaFX?
问题描述
SELECT * FROM `employee` WHERE `name` LIKE "%شريف%"
上面的查询工作正常,并通过phpmyAdmin查询找到元素,但在JavaFX中使用它不能得到它。
并获得英文搜索,所以我需要在java中添加以允许我使用阿拉伯语进行搜索。
Above query works fine and find the element by phpmyAdmin query but using it inside JavaFX doesn't get it. And get the english searchs, So what I need to add in java to permit me search by Arabic.
推荐答案
根据我上面的评论,我想这是一个Java的编码 - 解码问题,并没有与JavaFX有任何具体关系,我也假设你没有得到任何例外。插入和检索数据时必须使用适当的标准。有用的信息,请访问如何存储阿拉伯语文本使用python的mysql数据库?
As per my above comments, I guess it to be a encoding - decoding issue of Java and has nothing specific to do with JavaFX and I also assume that you are not getting any exceptions. You have to use a proper standard while inserting as well as retrieving data. Helpful information is there at , How to store arabic text in mysql database using python?
请参阅本文仅适用于字节,以便您的应用程序始终正确国际化,字节编码和字符串
Refer this article to work only on bytes so your application is always properly internationalized , Byte Encodings and Strings
参考这个以及如何在Java中设置编码,如何我可以使用java将阿拉伯语单词插入mysql数据库
Refer this one too as how to set encoding in Java , How can I insert arabic word to mysql database using java
您的控制台可能启用了UTF8,因此您可以在那里匹配字符串并查看阿拉伯字符。
Your console might be UTF8 enabled so you are able to match strings there and see Arabic characters.
希望有所帮助。
这篇关于如何通过JavaFX从MYSQL显示阿拉伯语查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!