0
SELECT * FROM `employee` WHERE `name` LIKE "%شريف%"

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.

Hussein Ahmed
  • 730
  • 2
  • 7
  • 17
  • which version of Java , JavaFx and scene builder are being used? – Sabir Khan Dec 06 '15 at 05:10
  • Java 8, and JavaFX & scene builder have been used – Hussein Ahmed Dec 06 '15 at 20:00
  • Few more questions, 1. how you store Arabic in DB ? By setting utf8_general_ci for table columns ? if yes, you need to set UTF8 encoding in your connection string too. 2. What issues you encounter? any exceptions or you just don't receive any results? It seems a encoding - decoding issue, you can't directly work in Arabic. – Sabir Khan Dec 07 '15 at 10:30
  • Many thanks, I didn't set encoding in connection string. – Hussein Ahmed Dec 07 '15 at 14:31

1 Answers1

1

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

Refer this one too as how to set encoding in Java , How can I insert arabic word to mysql database using java

Your console might be UTF8 enabled so you are able to match strings there and see Arabic characters.

Hope it helps.

Community
  • 1
  • 1
Sabir Khan
  • 9,826
  • 7
  • 45
  • 98