I use CaptureChangeMySQL + ConvertJSONToSQL + PutSQL to sync data from mysql(5.7), in my table there is a json type column, I want to convert json to sql literal, use new String((bytep[]) json, StandardCharset.UTF_8) to parse it but get wrong result:enter image description here

byte[] is:

enter image description here

The actual value in table is: [{id: 13182, name: "2730"}]

So how can I parse mysql json value correctly?

1 Answers

hiway On

use JsonBinary.parseAsString(byte[]) to parse.