• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NON-English chars become "???" when inserting data

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to insert Hebrew characters into a VARCHAR column in a MSSQL Server 7.0 database. I am using the JdbcOdbcBridge on jdk1.3.01_1
w/ win2000. It does not want to accept the characters... All Hebrew character become "???" (question marks).
I tried to set a Properties object with charSet property set to
"ISO-8859-1" (which supports Hebrew).
Another trial was to use PreparedStatement.setCharacterStream (which supports Unicode!!!).
I tried you use setByteStream() into a BINARY column.
I tried to serialize the whole String with the Hebrew data into a
BINARY column.
ALL OF THESE DIDN'T HELP!!!
Everytime I select the data it comes out with "???". I know that the problem is during inserting the data, because when I type Hebrew data in the Enterprise Manager (directly to the table), the application manages to select the Hebrew data properly.

Any idea???
Thanks!
David.
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It may be a case where you should be using unicode instead of ascii. I believe you also need to set up your columns as nvarchar (there are unicode equivalents to char, varchar, etc)
Dan
 
David Treves
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Daniel Dunleavy:
It may be a case where you should be using unicode instead of ascii.
David - What do you mean by that, isn't Java is Unicode based? using PreparedStatement.setCharacterStream() is unicode baed (according to the API).
I believe you also need to set up your columns as nvarchar (there are unicode equivalents to char, varchar, etc)
Dan



Thanks,
David.
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but when your database does not know if your going to use Java or M$. I was talking about your M$ SQL SERVER database column definitions.
Dan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic