By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

Property for setting codepage or codeset in JDBC

P: 2
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\".\"TABLE1\" 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 = "";
String url = "....";
String username = "demouser";
String password = "demouser";
java.util.Properties prop = new java.util.Properties();
prop.put("user", username);
prop.put("password", password);
prop.put("DB2e_ENCODING", "IBM-943");
prop.put("codepage", "943");

Class.forName(driver); conn = (DB2Connection)DriverManager.getConnection(url, prop);

Does anybody know what the correct properties name is?

Sep 12 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.