Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to insert japanese data from a jsp to DB2

 
Nitin Jengte
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to insert japanese data from jsp. In the jsp I have one field and I am copying a japanese text in it and then posting this request to DB2.
When I am trying to retrieve this data in another jsp, I am getting junk(???).
Pl. help me to solve this problem.
Thanks in advance
Regards
Nitin
 
sachin kotgire
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this code in your JSP
<%
String s1 = request.getParameter("param");
s1 = new String(s1.getBytes("ISO-8859-1"), "UTF-8");
%>
the string s1 will have your japanese character data. You can use this string to insert into the database.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!