2014-12-03 65 views
-1

我已經在數據庫中創建了一個由telugu數據組成的表格。當我嘗試在java中使用eclipse檢索泰盧固語數據時,我正在用矩形框出去。我們怎樣才能看到沒有矩形框的輸出

代碼:

try { 
     Class.forName("com.mysql.jdbc.Driver"); 
     con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sloka?useUnicode=yes&characterEncoding=UTF-8", "root", ""); 
     st = con.createStatement(); 
    } catch (Exception e) { 
     System.out.print("error:" + e); 
    } 

public void getData() { 
    try { 
     String query = "select * from eesavyasa "; 
     rs = st.executeQuery(query); 
     System.out.print("records from database"); 
     while (rs.next()) { 
      String name1 = new String(rs.getBytes("firstcolumn"), "UTF-8"); 
      String name2 = new String(rs.getBytes("secondcolumn"), "UTF-8"); 
      String name3 = new String(rs.getBytes("thirdcolumn"), "UTF-8"); 
      String name4 = new String(rs.getBytes("fourthcolumn"), "UTF-8"); 

      System.out.println(name1); 
      System.out.println(name2); 
      System.out.println(name3); 
      System.out.println(name4); 

     } 
    } catch (Exception ex) { 
     System.out.print(ex); 
    } 

} 

我們已經使用了整理UTF-8的數據庫,表,爲所有,但我們在矩形框 請回覆儘快

+0

你的字體不支持Unicode的點... – MadProgrammer 2014-12-03 06:46:49

+0

u能PLZ定義它恰恰 – edwin 2014-12-04 06:06:20

+0

要顯示的字符在您使用的字體中不可用,請更改字體... – MadProgrammer 2014-12-04 06:06:56

回答

0

將它固定獲得輸出下面連接後SQL執行後到mysql

SET NAMES utf8 
+0

可以用u plz來精確定義它 – edwin 2014-12-03 08:38:22