jhc-systems / debezium-connector-ibmi

Debezium Connector for IBM i (AS/400)
16 stars 12 forks source link

force ccsid on tables #35

Closed msillence closed 1 year ago

msillence commented 1 year ago

A legacy app has written data into tables using the wrong ccsid Please add support to force the ccsid both for jdbc and for journal chagnes

for remote calls pass the ccsid into the constructor:

AS400Text uk = new AS400Text(200, 285);

for jdbc (the default translate binary=false config is correct - don't override it) retrieve bytes as binary then convert locally using the ccsid

try (ResultSet rs = ps.getResultSet()) {
    while (rs.next()) {
        byte[] b = rs.getBytes(1);
        new String(b, Charset.forName("CP285"));
msillence commented 1 year ago

instead of manually converting from binary for every jdbc type we can override the ccsid behaviour in JDBC we still need to manually create the right ccsid in the as400text objects - this also fixes the auto detection when we don't override the ccsid

fix https://github.com/jhc-systems/debezium-connector-ibmi/pull/36

msillence commented 1 year ago

fixed in new build