2014-02-12 101 views
0

我有從表中執行數據的方法。我如何將這些記錄傳遞給Google網絡工具包的數據網格?如何發送字符串到GWT DataGrid?

public void getAllGitRecords(){ 
    try { 
     db = new ODatabaseDocumentTx(dbAdres); 
     db.open("admin", "admin"); 
     try { 
      for (ODocument gitCommitsTable : db.browseClass("GitStorage")) { 
       //May be I should put the data in some container here? 
       //So what kind of container it could be? 
       System.out.print(gitCommitsTable.getRecord().getIdentity() + " | "); 
       System.out.print(gitCommitsTable.field("sha") + " | "); 
       System.out.print(gitCommitsTable.field("comment") + " | "); 
       System.out.print(gitCommitsTable.field("date") + " | "); 
       System.out.print(gitCommitsTable.field("h") + " | "); 
       System.out.print(gitCommitsTable.field("m") + " | "); 
       System.out.println(gitCommitsTable.field("l") + " | "); 
      } 
     } catch (IllegalArgumentException ex) { 
      System.out.println("The table GitStorage is empty"); 
     } 
    } finally { 
     db.close(); 
    } 
} 
+0

這是服務器或客戶端代碼? – Akkusativobjekt

+0

這是一個服務器代碼 – cadmy

+0

然後,您還必須先將數據傳輸到客戶端。例如通過RCP(http://www.gwtproject.org/doc/latest/tutorial/RPC.html)。 – Akkusativobjekt

回答