JDBC connection to an Hebrew ANSI database

Hi,

I am connecting via JDBC to an ANSI database with Hebrew strings (the character's decimal value is between 224 and 250).

When reading the data from the database, I get garbage instead of the correct Unicode strings.

Obviously, the JDBC should do the decoding using the system's default encoding for non-Unicode programs, or a parameter stating the encoding to use (this way an ANSI character with decimal value 224 will be translated to a Unicode character with decimal value 1488).

The problem is - how do I tell the JDBC to do this conversion, and where do I define the encoding to use?

Regards,
Tal.
travehAsked:
Who is Participating?
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.

CEHJCommented:
What database?
travehAuthor Commented:
Oracle 8
CEHJCommented:
Try setting a charset of Cp1255 in your connection string. See driver docs for details
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

travehAuthor Commented:
Hi Cehj,

Thanks for your quick response.

I spent a couple of hours searching through documentation and in the internet, but could not find any explanation or example of how the charset is used within the database connection string.

I guess I'm missing something...

Can you give a specific example of how this can be used, or point me somewhere this is explained?

Many thanks,
Tal.
CEHJCommented:
Very difficult to find this sort of thing! Which driver are you using?
doronbCommented:
Just a quick thought, did you talk to the Oracle people in Israel, Tal? (I assume you're in Israel, of course...)
travehAuthor Commented:
Hi Doron,

I was not aware I can contact Oracle people in Israel... do they have an Israeli support center?
CEHJCommented:
It may be quicker to trial and error connection string configs ;-)

Try

charset=Cp1255

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
doronbCommented:
Yes, they do have an Israeli support center, although, you may find that you actually have to pay for support.  Also, you can try to search their OTN like this:

--> http://www.oracle.com/ultrasearch/wwws_otn/searchotn.jsp?p_Action=Search&p_Query=Hebrew
doronbCommented:
works for me :)
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.