Property for setting codepage or codeset in JDBC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • caesarkim
    New Member
    • Sep 2008
    • 2

    Property for setting codepage or codeset in JDBC

    I need to connect to the db (created with "IBM-943" codeset) on DB2 AIX . I am having a problem retrieving data with japanese character in 'where' clause something like this.

    SELECT * FROM \"TEST\".\"TABL E1\" WHERE COL2 like '%㈱%'

    It returns nothing. So I want to try to set the codepage(the same code page that db uses) in JDBC level to see if it retrieves something.

    Here is what I am trying. But I am not sure if I am using valid properties.
    String driver = "com.ibm.db2.jc c.DB2Driver";
    String url = "....";
    String username = "demouser";
    String password = "demouser";
    java.util.Prope rties prop = new java.util.Prope rties();
    prop.put("user" , username);
    prop.put("passw ord", password);
    prop.put("DB2e_ ENCODING", "IBM-943");
    prop.put("codep age", "943");

    Class.forName(d river);
    com.ibm.db2.jcc .DB2Connection conn = (DB2Connection) DriverManager.g etConnection(ur l, prop);

    Does anybody know what the correct properties name is?

    Thanks.
Working...