Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use hibernate with thai language?

 
Ch chai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get parameter from servlet

String oldStr = req.getParameter("firstName");

String newStr = new String(oldStr .getBytes("ISO8859_1"),"TIS-620");
customer.setFirstName(oldStr);
session.save(customer);

When query in database not thai language
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont know anything about the encodings but this code does not do anything but setting a request parameter to a bean:

String oldStr = req.getParameter("firstName");

String newStr = new String(oldStr .getBytes("ISO8859_1"),"TIS-620");
customer.setFirstName(oldStr);
session.save(customer);

no changes of the encodings because you set oldStr to the customer and not newStr. is this what you intended to do ?:

String oldStr = req.getParameter("firstName");

String newStr = new String(oldStr .getBytes("ISO8859_1"),"TIS-620");
customer.setFirstName(newStr);
session.save(customer);

or was this just a typo ?
what about your database settings ?
what if you store the string manualy (JDBC) in your DB ?

cheers

pascal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic