Reading Unicode data from an Access database using JDBC

你离开我真会死。 提交于 2019-12-30 10:40:07

问题


I have an MS-Access database, which I am connecting to in Java using the JDBC (I think the JDBC-ODBC bridge). My access database has some values which are in hebrew.

When I try to read these values using String str = rs.getString(1) (rs is a RowSet), the string I get is just a string of question marks.

I have other strings in hebrew, which I set in the Java code using string literals, and they work fine. So I'm pretty sure the problem is specifically with reading from the db.

I'm very new to this whole thing, so I could easily be missing something stupid... I searched Google for a while and didn't come up with anything, except some people saying that there's a chance this kind of thing is not supported (say somewhere that the JDBC-ODBC bridge has a bug with regards to Unicode, but it was from 2005, so who knows?).

I'd appreciate any help, thanks.


回答1:


Have you tried to set the charSet prior to calling the query?

Refer to: http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/bridge.html



来源:https://stackoverflow.com/questions/1467412/reading-unicode-data-from-an-access-database-using-jdbc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!