Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Microsoft Access Encoding

Hello!

I try to load data from a Microsoft Access Database in Windows 7.
I use EclipseLink JPA 2.4.1.

Map<String, String> props = new HashMap<String, String>();
props.put(PersistenceUnitProperties.JDBC_DRIVER, "sun.jdbc.odbc.JdbcOdbcDriver");
props.put(PersistenceUnitProperties.JDBC_URL, "jdbc:odbc:mydb");
props.put(PersistenceUnitProperties.TARGET_DATABASE, "org.eclipse.persistence.platform.database.AccessPlatform");
// is this parameter for JDBC-ODBC bridge used???
props.put("charSet", "iso-8859-1"); 

EntityManagerFactory emf = Persistence.createEntityManagerFactory("foo", props);
em = emf.createEntityManager();

If I query my database (e.g. em.find(StringTable.class, 7)) my text encoding is destroyed in string properties in the entity. Strings like "Müller" result in in Java string like "M?ller",

It is for sure an encoding issue. But at which point or using which property do I set the correct encoding for the Access Database?

Greets
Stefan Teitge

Back to the top