MxDev -2 Junior Poster

Hi guys,
how to read a unicode characters (arabic characters) form ResultSet object which appears after extraction as question marks like this(?????) i've tried to use the "getUnicodeStream()" method and "getCharacterStream()" method but both leads to the same results, does anyone have a workaround to this problem.

Thanks in advance.

Here's the code below:

package dbWordsPackage;
import java.io.*;
import java.sql.*;
import javax.swing.JOptionPane;

/**
 *
 * @author EL-Prince
 */
public class dbWordsCon {

    public String URL = "jdbc:odbc:dbWords";
    public String Driver = "sun.jdbc.odbc.JdbcOdbcDriver";

    public Connection Con = null;
    public Statement Stmnt = null;
    public ResultSet rs = null;

    public dbWordsCon(){

        try{
            Class.forName(this.Driver);
            this.Con = DriverManager.getConnection(URL);
            this.Stmnt = this.Con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
            ResultSet.CONCUR_UPDATABLE);

            String sqlQuery = "SELECT * FROM words" ;
            rs = Stmnt.executeQuery(sqlQuery);

            String result = null;

            while(rs.next()){              
                         
                BufferedReader r = new BufferedReader(rs.getCharacterStream(3));  
                JOptionPane.showMessageDialog(null, r.readLine());
            }
        }catch(SQLException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException e ) {
            e.printStackTrace();
        }catch(Exception exp){
            exp.printStackTrace();
        }// End of catch
    }// End of constructor

}
stephen84s commented: 35 posts and still no code tags -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.