This post refers to the issue of garbled characters displayed when GBK data is queried. Solution can be found below.
Symptom
Garbled characters are displayed when GBK data is queried through JDBC.
Cause analysis
The encoding format is not GBK on the client.
The possible cause is that the Java character encoding is not GBK.
Solution
Set the Java character encoding to GBK.
String url="jdbc:postgresql://1.1.1.1:25308/postgres?useUnicode=true&characterEncoding=gbk&allowEncodingChanges=true";