4

In my project, I am storing the non-English character in database. I successfully stored the non-English character but when I try to retrive that value, I am getting the string like below:

How to convert this? Into 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 database it displays அன்பு but retrieving it displays ????? Any help will be greatly appreciated!

cнŝdk
  • 31,391
  • 7
  • 56
  • 78
Selva
  • 1,620
  • 3
  • 33
  • 63

1 Answers1

0

A wild guess. You are storing the data in VARCHAR datatype change it into NVARCHAR and it will work. This happend with me during storing arabic charachters

An NVARCHAR column can store any Unicode data. A VARCHAR column is restricted to an 8-bit codepage.

Sachu
  • 7,555
  • 7
  • 55
  • 94