my dog learned polymorphism*
The moose likes Servlets and the fly likes Special character handling in DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Special character handling in DB2" Watch "Special character handling in DB2" New topic
Author

Special character handling in DB2

Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Hi all,

I am submitting special character from form to servlet and storing it into database. I am using UTF-8 across the all application (JSP, Servlet and DB2). Everything is working fine but in database this symbol is taking 3 character instead of 1. My database table column type is varchar. My question is that is everything alright here and why this is happening.
Phani Raju
Greenhorn

Joined: Aug 03, 2007
Posts: 19
Have you verified what charset your database is setup with?
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Phani Raju wrote:Have you verified what charset your database is setup with?


Yeah as i mentioned above everything is in UTF-8.
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Jagdeep Sharma wrote:
Phani Raju wrote:Have you verified what charset your database is setup with?


Yeah as i mentioned above everything is in UTF-8.




I mean on JSP i use UTF-8 (in page directive)
servlet - req.setCharacterEncoding("UTF-8")
database has UTF-8 charset.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Special character handling in DB2
 
Similar Threads
Charset & encoding Problem
Problem Loading DB2 Driver
Special character handling
exchanging encrypted values as request parameters.
Special characer in Database + problem in trimming it with trim()