But there is an easy way to fix this problem. You need to set the translateBinary Option to true when you connect to your System i and every 65535 character field will be translated from EBCDIC to Unicode automatically.
AS400JDBCDataSource dataSource = new AS400JDBCDataSource(systemName, userName, password);
dataSource.setTranslateBinary(true);
Connection conn = dataSource.getConnection();
// Or when you prefer the old connection Method
Connection conn2 = DriverManager.getConnection("jdbc:as400://" + systemName + ";translate binary=true",
userName, password);
Then the result is human readable.


No comments:
Post a Comment