Q:

How to correctly insert utf-8 characters into a MySQL table using jpa

I want to insert in MySQL database information by my web application. I do it by OpenJPA at TomEE server
for example:
public void addLecturer(String name, String surname) {
    Lecturer lect = new Lecturer(name,surname);

    em.persist(lect);
}

where Lecturer is entity class. The problem is that application insert data in latin1 encoding. I want to insert it in UTF-8 encoding. 
When I insert data by simple MySQL command in command line terminal i get information in UTF-8 encoding.
I have looked at this and I see character_set_server is set as latin1 but I don't know if this is the problem or how to change it:
mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

Edit
I have same problem like there:
JPA utf-8 characters not persisted
and 
UTF - 8 with JPA and Glassfish 4.0
I add useUnicode=yes, characterEncoding=utf8 and characterSetResults=utf8 to my property javax.persistence.jdbc.url but it doesn't help.

A:

Ok, I find resolve:
I get data by JTA so I get the data for persistence.xml from datasource defined in tomee.xml:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
  <Resource id="database" type="DataSource">
    JdbcDriver com.mysql.jdbc.Driver
    JdbcUrl jdbc:mysql://localhost:11080/db?zeroDateTimeBehavior=convertToNull&amp;characterEncoding=utf8&amp;characterSetResults=utf8
    UserName my
    Password pass
  </Resource>
</tomee>

So I had to add &characterEncoding=utf8&characterSetResults=utf8 to JdbcUrl parametr in tomee.xml file (note that to valid xml I had to use &amp; instead of &). I don't have to add this informatation to persistence.xml (only because i use JTA).
Now everything works great. Thank's to arievanwi for direct me to resolve of problem.

A:

2 Steps
Append the query string to jdbc url 
?characterEncoding=utf-8    

Run the following sql command on the table
ALTER TABLE <tablename> CONVERT TO CHARACTER SET utf8 COLLATE
utf8_unicode_ci;

