ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wengyao04 <wengya...@gmail.com>
Subject Sql query cannot handle special character like ½
Date Wed, 12 Jun 2019 16:24:54 GMT
Some of our string fields contain special characters like  ½. When we use get
API to retrieve the object from the cache by key, and print out the field
having special characters,  the special characters are displayed correctly. 

However, when we use SqlFieldsQuery to select the field like the following

 String sql = "SELECT id, shortName from Warrant where id = ?";
 QueryCursor<List&lt;?>> cursor = mycache.query(new
List<List&lt;?>> rows = cursor.getAll();
for (List<?> row : rows) {
    System.out.println(row.get(0) + " " + row.get(1));

The special character does not decode correctly, it shows "?" instead of "½"

How could we fix this problem when using SqlFieldsQuery  to query string
field containing special character ?


Sent from: http://apache-ignite-users.70518.x6.nabble.com/

View raw message