Non-English character is how is it?

In my project, I store a non-English character in the database. I successfully saved a non-English character, but when I try to extract this value, I get a string as shown below:

How to do it? In character? Below is my code

TblNames name=new TblNames();
name.setName("அன்பு");
session.save(name);
Criteria cr=session.createCriteria(TblNames .class);
List<TblNames > tempList=cr.list();
System.out.println(tempList.get(0).getName());

In the database, it displays அன்பு, but retrieving it displays ????? Any help would be greatly appreciated!

+4
source share
1 answer

Wild hunch. You save the data in VARCHARdatatype format, change it to NVARCHARand it will work. It happened to me during the storage of Arabic characters

You NVARCHARcan store any Unicode data in a column . Column is VARCHARlimited to 8-bit codepage.

0
source

All Articles