Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipselink / MySQL / UTF-8 Issues
Eclipselink / MySQL / UTF-8 Issues [message #1741571] Thu, 25 August 2016 21:34 Go to next message
Richard Harrison is currently offline Richard HarrisonFriend
Messages: 3
Registered: October 2014
Junior Member
I've set up a small project using Struts 2, Tomcat, Eclipselink and MySQL, which needs to store some special characters in the database using UTF-8. I set up the database tables as "utf8_unicode_ci". The persistance.xml file looks like this:

<properties>
	<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
	<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/xxxxxx?useUnicode=true&amp;characterEncod‌​ing=UTF-8" />
	<property name="javax.persistence.jdbc.user" value="yyyyyyyy" />
	<property name="eclipselink.logging.level" value="FINE"/>
	<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
	<property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
	<property name="eclipselink.create-ddl-jdbc-file-name" value="datastore-create.sql"/>
	<property name="eclipselink.drop-ddl-jdbc-file-name" value="datastore-drop.sql"/>
	<property name="eclipselink.application-location" value="/home/richardh/dddd/"/>
	<property name="eclipselink.deploy-on-startup" value="false"/>
	<property name="javax.persistence.jdbc.password" value="zzzzzzz"/>
</properties>


When special characters are entered through the app, the EclipseLink logs show that the special characters are in the statement as it is logged. However, they aren't in the database correctly. (They show up as "?".) When I take the same statement and manually run it against the database, it works fine. I'm not sure where to go from here.

Thanks in advance for any ideas anyone can provide.

[Updated on: Thu, 25 August 2016 22:06]

Report message to a moderator

Re: Eclipselink / MySQL / UTF-8 Issues [message #1741580 is a reply to message #1741571] Fri, 26 August 2016 05:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33226
Registered: July 2009
Senior Member
It's better to as on the EEclipseLink forum.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Need Help Getting Auto Grader Working For Class
Next Topic:Issue on install of Eclipse Java Developers
Goto Forum:
  


Current Time: Sun Oct 13 07:39:12 GMT 2024

Powered by FUDForum. Page generated in 0.04096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top