Hello! I am new to this forum and also a new learner of this framework.
I have an oracle 10g database and I decided to select the data from tables using plsql procedures. What i don`t know is how to bind the result set obtained in java with the container to put selected data into a table in vaadin interface.
I get the result set like:
- USERI = oracle package
- GET_USERI = procedure in the package
[code]
ConnectionPool pool=new ConnectionPool();
Connection conn=pool.get_connection();
ResultSet rs = null;
if (conn != null){
CallableStatement stmt = conn.prepareCall("{call USERI.GET_USERI(?)}");
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.execute();
rs = (ResultSet) stmt.getObject(1);
while (rs.next()) {
new Notification(rs.getString(1),"",
Notification.TYPE_WARNING_MESSAGE, true)
.show(Page.getCurrent());
}
stmt.close();
conn.close();
}
[/code]Now my data is in the resultset.
I have the table and “data” as the (empty) datasource:
t = new Table();
t.setSizeFull();
t.addStyleName("borderless");
t.setSelectable(true);
t.setColumnCollapsingAllowed(true);
t.setColumnReorderingAllowed(true);
//data.removeAllContainerFilters();
// t.setContainerDataSource(data);
sortTable();
t.setVisibleColumns(new Object[] { "Cont", "Nume", "Prenume" });
t.setDragMode(TableDragMode.MULTIROW);
t.setMultiSelect(true);
How to insert data obtained from the resultset “rs” into the container “data”? Or, how to do it to fill the table with the selected data and also benefit from the vaadin framework magic interface capabilities? Thank you!