This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Need help. Special Characters(�) retrieval from the database using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need help. Special Characters(�) retrieval from the database using JDBC" Watch "Need help. Special Characters(�) retrieval from the database using JDBC" New topic
Author

Need help. Special Characters(�) retrieval from the database using JDBC

Raghu Rao
Greenhorn

Joined: Oct 13, 2004
Posts: 1
I am trying to retrieve Trademark(�) character from the database using java. The driver used is a Default DB2 JDBC Driver. When I retrieve registered (�) character, I am able to see it perfectly fine, but when I retrieve trademark (�) character, I get a question mark character (?). Please let me know what I would have to do to pick the trade mark character.

I am creating a connection, creating a statement, calling executeQuery with a stored proc., and then tried calling getString and getBytes, but wasn't successful.

Please let me know if you know how I should retrieve the Trademark(�) character.

Thanks,
Raghu

[ October 13, 2004: Message edited by: Raghu Rao ]

[ October 13, 2004: Message edited by: Raghu Rao ]
[ October 13, 2004: Message edited by: Raghu Rao ]
William A White
Ranch Hand

Joined: Jul 01, 2004
Posts: 35
Originally posted by Raghu Rao:

I am creating a connection, creating a statement, calling executeQuery with a stored proc., and then tried calling getString and getBytes, but wasn't successful.

Please let me know if you know how I should retrieve the Trademark(�) character.


I had a very similar problem with French characters. It turned out that the particular installation of Tomcat/Linux/Java that I was using was not picking up the correct default character encoding - adding the CharSet parameter to the JDBC URL solved my issue - something like your_url_here?CharSet=ISO-8859-1
 
Consider Paul's rocket mass heater.
 
subject: Need help. Special Characters(�) retrieval from the database using JDBC