How to use ibatis to insert records for NVARCHAR2

How can i insert a string into a NVARCHAR2 field using ibatis? i am puuting a string variable into a map, and pass the map to ibatis for processing, but i couldnt append the "N" in front of the string. e.g N'string'.
AngoraAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ksivananthCommented:
>>but i couldnt append the "N" in front of the string. e.g N'string'.

why you have to?
0
AngoraAuthor Commented:
i try inserting chinese character without the 'N', then data store is '??'
0
ksivananthCommented:
that means you are dealing with diff( DB is in diff charset than the string you store ) charsets, you should store them as unicode( if its in diff encoding, you need to convert it to unicode ) and set the appropriate charset in DB too!
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

AngoraAuthor Commented:
I try to use the direct jdbc connection with the N'string', and it actually work. So i not too sure what is missing when i use that with ibatis
0
AngoraAuthor Commented:
The sql statement that work is something like this:
INSERT INTO SomeMultiLangTable (userfname)
VALUES(N' " + Request.QueryString["lang"] + " ') ";

when i use this in ibatis , it become
INSERT INTO SomeMultiLangTable (userfname)
VALUES(#string#).

I use a map for the #string#, so i use map.add("string", " N' "+Request.QueryString["lang"] +" ' "), but this ended inserting " N'stringcontent' " to the database. and when i insert chinese char in, it insert ?? into it
0
AngoraAuthor Commented:
Hi, the problem is solved by writing an typehandler for the jdbcType: nvarchar
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kevin CrossChief Technology OfficerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.