从阿拉伯访问数据库访问数据

时间:2015-04-20 23:05:46

标签: java database ms-access unicode

我有一个包含英文和阿拉伯文字母以及java程序的访问数据库。当我从我的Java程序中选择或插入数据到该数据库时,它使用英语单词,但阿拉伯语单词更改为问号,如:????????

谁能帮助我解决它......

这是连接的代码:

try {
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\Users\\hamreen\\workspace\\advanced kurdish dictionary\\words.mdb;";
    //?useUnicode=true&charachterEncoding=utf-8
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection(database+"?useUnicode=true&charachterEncoding=utf-8","","");
} catch (Exception e1) {
    System.out.println("The exception raised is:" + e1);
}

选择代码:

try {
    Statement stmt1=con.createStatement();
    stmt1.executeQuery("select * from AA where en like '"+text+"%' order by en asc");
    //   stmt1.executeQuery("select * from test where en='"+temp+"'");///  bo kurdi
    ResultSet rs1=stmt1.getResultSet();
    int count=1;
    while(rs1.next()&&count!=5){
        englishMeanTextArea.append(rs1.getString(1)+"\n\n");
        kurdishMeanTextArea.append(rs1.getString(2)+"\n\n");
        count++;
    }
}catch (Exception e1) {
    System.out.println("The exception raised is:" + e1);
}

0 个答案:

没有答案