Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
David Treves
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic