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.

Unanswered: Error fetching Registered Trademark symbol from DB2 9.7

I have DB2 9.7 in which one of varchar column stores registered trademark symbol - ®.
When my J2EE application tries to read it using JDBC, the symbol fetched is inconsistent.
Most of the times it comes ®, but sometime it comes as question mark - ?

Have you checked whether the correct bytes were stored in the DB2 table? You can use the HEX() function for that. If this is working fine, you'll have to make sure that your client is using the correct code page as well so that the code point (which is just a number) returned by DB2 maps to the (R) symbol in the client's code page.

If things sometimes work, sometimes not, I suspect that the code pages setting in your application is not consistent. If the application is Java, you should always have UTF8, but then you have to make sure you also insert the data as UTF-8 and that your front end (shell or browser or whatever) doesn't mangle the character representation. In order to verify this, I would look at the numerical value, i.e. the code point, in all stages of the chain.

its most probably the application which is inserting data into the table as few records with "?". For finding the root cause, you can export that particular field into a flat file and scan for any records with "?" and not with the registerd trademark symbol. If such data exists, then you need to fix the application code which is inserting the records.

The question mark that you see is most likely the "substitution character", which a component in the data flow chain uses when it cannot represent a certain character.
This can happen e.g. when DB2 stores the ® as UTF-8 (check this, i.e., verify which code page DB2 is using for your data column), and the application (or maybe one of the intermedate "application layers" like e.g. DB2 Connect) uses a codepage that does not have the ® character.
But it could also happen when the (intermediate) application *thinks* it does not have the input character in its codepage, since it *thinks* DB2 is using a different codepage then the one it does use.
Or (more likely) when it tries to convert the DB2 character from the (correct) DB2 codepage to the (erroneously assumed) codepage of the application without ® (while the correct codepage of the application actually has the ® character).

Sorry, was struck in another issues. So was not able to look into this.

I got the code page for the DB as below but was not sure how to get it for my application. It is a J2EE application running WAS 6.1 server. There is no UI and MDB drives the application. Please advise.

I got the code page for the DB as below but was not sure how to get it for my application. It is a J2EE application running WAS 6.1 server. There is no UI and MDB drives the application. Please advise.

Database code page = 1208
Database code set = UTF-8

Code page 1208 is indeed UTF-8, which should be fine in all respects. Could be an erroneous setting in the J2EE app. or maybe in the DB settings of WAS.
Which all seem unlikely to me.

Try to find out which other characters have the same problem (like accented letters: é ù è à, or the euro sign: €) and in which circumstances the problem shows up and when it doesn't. (e.g.: on the way into the database: in that case, from which data source; on the way out: which component is responsible for diplaying the character(s); ...)