0

我有一个包含阿拉伯表格的数据库,我可以从 Netbeans 读取它,所以我可以看到阿拉伯字符并将其写入表格,但我想使用 Eclipse 读写,我试过这样:

String unicode1 = "?useUnicode=yes&characterEncoding=UTF-8";
        Class.forName("com.mysql.jdbc.Driver");
        Connection con = (Connection) DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/searchengine"+unicode1, Username, Password);
        PreparedStatement statement = (PreparedStatement) con
                .prepareStatement("select * from invertedindex");
        ResultSet results = statement.executeQuery();
        while (results.next()) {
            System.out.println(results.getString(1));
        }

但我仍然看到阿拉伯字符像问号,我做错了什么

**注意:** 这些表支持阿拉伯字符,因为我可以使用 Netbeans 读取和写入同一个表

编辑

我试过System.out.println("يييي");了,但我有问号,好像我有阿拉伯字符但 Eclipse 没有显示它

4

1 回答 1

2

尝试select convert(name using UTF8) from invertedIndex

于 2012-06-22T06:12:14.443 回答