unable to insert french chars to db from java application
I'm using jdbc type IV driver (jdk 1.2) to connect to Teradata from my application(which is hosted on Unix box).
I'm executing the sql using Statement.executeBatch.
One of the values I'm trying to update the database with has a french character- like caf?br>The query gets printed on the console correctly with the word 'caf? but it is stored as 'caf?' in teradata db.
When I directly update teradata db, I'm able to update it with these characters successflly.
And PreparedStatement might have handled this, but I need to use Statement as
batch mode works only with Statement for this jdbc driver.
Any idea what could be the solution for this problem?
Thanks
It's probably stored correctly in the database, but whatever is rendering the contents is using a font / character-set which doesn't have a glyph for that particular character, so it renders it as the default "?" character to let you know that.
Usually a question mark indicates an unsuccessful conversion, while a font problem would be indicated by a square box.
Also, the fact that the character in question can be entered and rendered directly in the db would indicate that the font is fine.
I don't know the db in question (and the original post doesn't say what the encoding of the db is set to), so I won't venture a guess as to how the conversion fails.
I read somewhere that Teradata can also read unicode.Anyway this column is set to Latin. And Im able to directly insert records.
I view the records using teradata sql assistant - and the records inserted by the java application have a ? for french character whereas the ones I inseretd manually are displayed correctly.
> I read somewhere that Teradata can also read
> unicode.Anyway this column is set to Latin. And Im
> able to directly insert records.
> I view the records using teradata sql assistant - and
> the records inserted by the java application have a ?
> for french character whereas the ones I inseretd
> manually are displayed correctly.
Ok, so that lends more credit to one_dane's response. Somewhere in your Java code you are munging the string.