-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow overriding ccsid #68
Comments
@msillence, is this something you still would like help with? I can try to queue it up but I know this has been opened for a while, so I want to verify that there's still a need. |
yes, sorry I missed the email about this but we'd very much like to be able to directly map the the ccsid used rather than the ccsid configured |
I should also add that it turns out that the simple force ccsid doesn't cut it. this is essentially the change: The rest of the files are just to make it use the overridden file. For someone that knows the code better, they might find a better solution |
original issue https://sourceforge.net/p/jt400/bugs/474/ - updated here
We have the not entirely unique problem of needing to read/write to a table with the wrong ccsid https://stackoverflow.com/questions/37409928/db2-on-as400-encoding-issue-with-jt400
however we also need to write to the database and though getBytes works for getting Strings out ignoring the encoding setBytes does not and is rejected as the wrong type
Also this means we need to replace every getString/setString with getBytes and the conversion
I note that AS400JDBCConnectionImpl has a getConverter(int ccsid) and we could enhance this to allow an overridden ccsid
We can configure it with
I know we should fix our tables but as it's consistently wrong in thousands of tables and all applications that use the tables the reality is we are more likely to replace the mainframe than fix the problem.
We can easilly override the existing implementation and have our local fix but injecting it is harder as the AS400JDBCDriver has the implementation hard coded in the private method prepareConnection so we also need to copy the entirity of AS400JDBCDriver
Lastly we need to make sure the original driver isn't registered
I fully expect this to be rejected as a proposal but thought it might be useful to others
full code here: https://github.com/jhc-systems/debezium-connector-ibmi/tree/main/jt400-override-ccsid
It seems my suggestion isn't complete and has some undesired results for using the metadata and retrieving the column names
jhc-systems/debezium-connector-ibmi#40
The text was updated successfully, but these errors were encountered: