If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Property for setting codepage or codeset in JDBC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-08, 15:39
caesarkim caesarkim is offline
Registered User
 
Join Date: Feb 2004
Posts: 11
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\".\"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 = "com.ibm.db2.jcc.DB2Driver";
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);
com.ibm.db2.jcc.DB2Connection conn = (DB2Connection)DriverManager.getConnection(url, prop);

Does anybody know what the correct properties name is?

Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On