Hibernate / MS SQL / Unicode



Hi,

I have a web-apps that sends unicode data to my servlet. I can save it ot he MS SQL server and when I read it using JDBC client (Squirrel), I can see the unicode correctly in the DB.
I use Hibernate to read/write to the DB.
I Hibernate reference docs, I didn't find anything about unicode values. The funny thing is I can save correctly.... but when I try to query it doesn't work.
A simple query like


session.createQuery("from User where username='xxxxxx'");

( where 'xxxxx' is a unicode String)
it returns nothing.
I triied to add a capital "N":

session.createQuery("from User where username=N'xxxxxx'");

which shows a Hibernate error ( "unexpected token '??????'");

Any idea as how I can write a "where" clause with Hibernate with unicode values?

Thank you.

--
JSC
.



Relevant Pages

  • RE: Asking again - ResultSet.getString() & unicode
    ... I stepped through the hibernate code. ... > Hi Dave, ... > that the hibernate component can correctly process the Unicode data through ... > |> Microsoft Online Support ...
    (microsoft.public.sqlserver.odbc)
  • Re: Query output is always in UNICODE... need ANSI ... Help?
    ... > I'm using XP_Sendmail stored procedure to run a query and mail the ... > UNICODE and the application that subsequently consumes the attachment ... > unmodified attachment in ANSI format makes the application all happy ...
    (microsoft.public.sqlserver.programming)
  • Re: Query output is always in UNICODE... need ANSI ... Help?
    ... > I'm using XP_Sendmail stored procedure to run a query and mail the ... > UNICODE and the application that subsequently consumes the attachment ... > unmodified attachment in ANSI format makes the application all happy ...
    (microsoft.public.sqlserver)
  • Query output is always in UNICODE... need ANSI ... Help?
    ... I'm using XP_Sendmail stored procedure to run a query and mail the ... UNICODE and the application that subsequently consumes the attachment ... unmodified attachment in ANSI format makes the application all happy ...
    (microsoft.public.sqlserver.programming)
  • Query output is always in UNICODE... need ANSI ... Help?
    ... I'm using XP_Sendmail stored procedure to run a query and mail the ... UNICODE and the application that subsequently consumes the attachment ... unmodified attachment in ANSI format makes the application all happy ...
    (microsoft.public.sqlserver)