使用JDBC从Access数据库读取Unicode数据

使用JDBC从Access数据库读取Unicode数据

本文介绍了使用JDBC从Access数据库读取Unicode数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MS-Access数据库,我使用JDBC在Java中连接(我认为是JDBC-ODBC桥)。我的访问数据库有一些希伯来语值。

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.

当我尝试使用String str = rs.getString(1)(rs是一个RowSet)读取这些值时,我得到的字符串只是一串问号。

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.

我有希伯来语中的其他字符串,我使用字符串文字在Java代码中设置,它们工作正常。所以我很确定问题是专门从数据库中读取的。

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.

我对这一切都很新,所以我很容易错过一些愚蠢的东西。 ..我搜索谷歌一段时间没有提出任何东西,除了一些人说有可能不支持这种事情(比如某个地方说JDBC-ODBC桥有关于Unicode的错误,但是它是从2005年开始的,所以谁知道?)。

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.

推荐答案

您是否尝试在调用查询之前设置charSet?

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

请参阅:

这篇关于使用JDBC从Access数据库读取Unicode数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:14