Search code examples
db2-400datagripjtopen

Connecting Jetbrains Datagrip to DB2 Version 7.5 encoding error


I am new to this so excuse and obvious issues. The only driver I can get a successful connection with is the JTOpen driver. I assume this is because our database version is so old. Anyhow, whats strange is one schema has the expected results but the other schema has columns that give results in EBCDIC, i believe. See my screen shot.

I have tried all of the drivers and the different types and versions but only JTOpen works with version 10.4


Solution

  • The schema you are getting funky data from has the character fields defined as CCISD(65535) aka "Binary data".

    By design, the JDBC driver won't translate that to ASCII or whatever your local language is.

    The right solution, is to ensure that your DB tables have the columns tagged with the appropriate CCSID.

    But as a workaround, you can set "translate binary" to true on the JDBC connection to force it to translate the mis-tagged fields.