characterEncoding in JPA SOLVED!

The idea was to be able to insert Cyrillic characters into mysql DB. The problem was that I was using JPA eclipse-link. It took me some time and a lot of nerves to find the solution. Just add to the persistence.xml, to the url property like this:


property name=”javax.persistence.jdbc.url”
value=”jdbc:mysql://localhost:3306/adscanner?characterEncoding=UTF-8″


Note the ? sign, not &! And don’t use useEncoding, it will not work. Only like this one.
fuck blogger.com for not allowing pasting source code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s