| |
|
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.
|
 |

07-28-11, 21:01
|
|
Registered User
|
|
Join Date: Dec 2009
Posts: 14
|
|
|
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 - ?
Could you please let me know what is correct way to fetch this?
So far tried below,
resultset.getString(columnname)
resultset.getBytes(columnname, "UTF-8")
Thanks,
Gokul
|
|

07-30-11, 13:32
|
|
Registered User
|
|
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
|
|
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.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
|
|

07-30-11, 15:35
|
|
Registered User
|
|
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
|
|
|
|
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.
Good Luck !
__________________
Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi
|
|

07-31-11, 12:57
|
|
Registered User
|
|
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
|
|
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).
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
|
|

08-02-11, 05:05
|
|
Registered User
|
|
Join Date: Dec 2009
Posts: 14
|
|
Thanks for your valuable inputs. Let me check these points and get back.
|
|

08-22-11, 19:16
|
|
Registered User
|
|
Join Date: Dec 2009
Posts: 14
|
|
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.
Database code page = 1208
Database code set = UTF-8
|
|

08-22-11, 22:50
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
Quote:
Originally Posted by cse_gokul
I have DB2 9.7 in which one of varchar column stores registered trademark symbol - ®.
|
How do you verify that?
Quote:
Originally Posted by cse_gokul
Most of the times it comes ®, but sometime it comes as question mark - ?
|
How do you know that?
|
|

08-23-11, 02:38
|
|
Registered User
|
|
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
|
|
Quote:
Originally Posted by cse_gokul
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); ...)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|