IBM Support

DB2 Universal JDBC/SQLJ driver on HP-UX - "encoding not supported"

Question & Answer


Question

When using the DB2® UDB v8 Universal JDBC/SQLJ driver with an application on HP connecting to an HP-UX DB2 UDB server, you will receive an "encoding not supported" error when the database has been created using the default codepage. Example 1: JDBC application example: try { Class.forName("com.ibm.db2.jcc.DB2Driver"); } catch(java.lang.ClassNotFoundException e) { .... } try { conn = DriverManager.getConnection("jdbc:db2:userdb", "test", "test"); ... } ... You may receive the following error: com.ibm.db2.jcc.b.DisconnectException: encoding not supported!! .... at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:135) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:172) .... Example 2: SQLJ applications could encounter a similar error at runtime or during developement using SQLJ utilities (db2sqljcustomize, etc. ). For example: [java] [ibm][db2][jcc][sqlj] encoding not supported!!

Cause

DB2 Universal JDBC/SQLJ driver depends on the JDK to perform the codepage conversions. However, the DB2 UDB Server on HP-UX cannot convert the default codepage of Roman8 for use by the JDBC/SQLJ application.

Answer


To work around this problem, modify the HP-UX environment variable LANG to the ISO locale and re-create your database. For example:
db2 terminate
db2 drop db userdb
export LANG=en_US.iso88591
db2 create db userdb

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming Interface - JDBC - Type 2","Platform":[{"code":"PF010","label":"HP-UX"}],"Version":"8","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21114928