All Forums Connectivity
Vesoni 5 posts Joined 06/06
23 Jun 2006
Inserting strings in UTF-8 Teradata using JDBC

Hi,How can insert UTF-8 bytes in Teradata in java using Teradata JDBC drivers?When I try with setBytes(int index, bytes[]) methodI get Conversion bteween BYTE data and other types is illegal.Any help?Veso

Vesoni 5 posts Joined 06/06
25 Jun 2006

Any idea?getString() i setString() work fine, but setString() just for ASCII chars. For others (example for Central Europe code page) insert "?" in database. getString() read every chars normal.Is it problem with JDBC drivers?Any solution from Teradata support?Thanks,Veso

tomnolan 594 posts Joined 01/08
05 Jul 2012

In order to use UTF8, you must specify the CHARSET=UTF8 connection parameter.

Then the Teradata JDBC Driver will handle all conversion from Java Strings into UTF8 encoding, before sending the data to the Teradata Database.

Do not bind character values using the setBytes method. Character values should be bound as Java Strings using the setString or setObject method.

You must sign in to leave a comment.