Re: JDBC to load UTF8@psql to latin1@mysql - Mailing list pgsql-general

From Edson Richter
Subject Re: JDBC to load UTF8@psql to latin1@mysql
Date
Msg-id BLU0-SMTP27000E7E9F778F81624DBD3CF4E0@phx.gbl
Whole thread Raw
In response to Re: JDBC to load UTF8@psql to latin1@mysql  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-general
Em 13/12/2012 12:00, Emi Lu escreveu:
>
>>> Is there a simple way to load UTF8 data in psql to mysql(with latin1
>>> encoding) through JDBC?
>>
>> All you need to do is to query the source database, then use
>> ResultSet.getString() to obtain the data and use a PreparedStatement and
>> PreparedStatement.setString() to insert/update  the data on the target
>> database.
>>
>> The JDBC drivers will handle all the conversion.
>> Do NOT manually convert the data.
>>
>> getString() and setString() will do everything correctly.
>
> I am not using stmt directly but through Mybatis for all db transactions.

Should not this a Mybatis problem instead?
As stated, JDBC drivers does all the conversion needed automatically,
but if you have a middleware messing with your enconding, then the
problem is the middleware, not databases or drivers.

Edson

>
> So, this approach will not work.
>
> Thanks.
> --
> Emi
>
>
>
>



pgsql-general by date:

Previous
From: Emi Lu
Date:
Subject: Re: JDBC to load UTF8@psql to latin1@mysql
Next
From: Emi Lu
Date:
Subject: Re: JDBC to load UTF8@psql to latin1@mysql