對vaadin來說非常新穎。我有一個任務,我應該顯示從MySQL數據庫中獲取數據並將數據顯示在表中。之後所有的CRUD操作都將完成。在vaadin中顯示來自mysql db表的數據
我正在使用純JDBC,java,vaadin。我試過和jdbc連接很容易。但我堅持在瀏覽器中顯示錶中的數據。
下面的代碼是我試過的。
SimpleJDBCConnectionPool pool = new
SimpleJDBCConnectionPool("com.mysql.jdbc.Driver",
"jdbc:mysql://localhost:3306/mg", "root", "root");
Notification.show("DB connected");
SQLContainer container = new SQLContainer(new FreeformQuery(
"SELECT * FROM PRODUCT", Arrays.asList("ID"), pool));
Notification.show("hi" +container);
Table table = new Table("Products", container);
現在我卡住了,如何在瀏覽器中顯示Products表中的數據。請給我建議,因爲我希望很多GURU都能輕鬆完成這一項。
謝謝,我會試試這個:) – user6250770
Insha allah ..我會這樣做的。 :) – user6250770