Re: JDBC to load UTF8@psql to latin1@mysql

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: JDBC to load UTF8@psql to latin1@mysql
Date: 2012-12-13 14:00:24
Message-ID: 50C9DF78.4050800@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>> 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.

So, this approach will not work.

Thanks.
--
Emi

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edson Richter 2012-12-13 14:05:06 Re: JDBC to load UTF8@psql to latin1@mysql
Previous Message wd 2012-12-13 13:46:43 Re: Corrupt indexes on slave when using pg_bulkload on master