I have problem reading non latin characters from a MS-Access 2000 or later table (Java 1.4.2 and 5.0). When I read a textfield that contains for example greek characters the string that I get back contains question marks.
Essentially my code looks like this:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Properties props = new Properties();
props.put ("charSet", "UTF-8");
Connection c = DriverManager.getConnection("jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=" + pDatabase, props);
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("SELECT myField FROM myTable");
I've tried many variations of ways to extract the data from the ResultSet, including getCharacterStream, getBytes, and getString (with various encodings such as "UTF8"), but non of them return greek, russian, chinese, etc. characters.
According to Microsoft, Access 2000 or later uses the Unicode character-encoding scheme to represent data in a textfield, so there should be no problem returning the correct characters in textfield using Java.
What am I doing wrong (apart from using MS-Access or not using a third party JDBC-Driver)?
Essentially my code looks like this:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Properties props = new Properties();
props.put ("charSet", "UTF-8");
Connection c = DriverManager.getConnection("jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=" + pDatabase, props);
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("SELECT myField FROM myTable");
I've tried many variations of ways to extract the data from the ResultSet, including getCharacterStream, getBytes, and getString (with various encodings such as "UTF8"), but non of them return greek, russian, chinese, etc. characters.
According to Microsoft, Access 2000 or later uses the Unicode character-encoding scheme to represent data in a textfield, so there should be no problem returning the correct characters in textfield using Java.
What am I doing wrong (apart from using MS-Access or not using a third party JDBC-Driver)?