Vaadin SQLContainer
Vaadin SQLContainer is a container implementation that reads it's contents from a JDBC data source.
Vaadin SQLContainer is meant as a replacement to the old QueryContainer and supports lazy loading and buffered writes.
Two modes of operation are supportedFreeformQuery and TableQuery:
FreeformQuery mode allows you to specify any complex query and have it's results populate the container, however you need to impelment support for writing, sorting, filtering and lazy loading by implementing the FreeformQueryDelegate interface.
TableQuery mode allows you to provide only a table name and the container takes care of populating itself and automatically supports writing, sorting, filtering and lazy loading for the following database engines: HSQLDB, MySQL, MSSQL, Oracle and PostgreSQL.
SQLContainer has been integrated into Vaadin 6.7 and this add-on will not receive any further updates. All changes will be made to the Vaadin Framework only.
Sample code
try { connectionPool = new SimpleJDBCConnectionPool( "org.hsqldb.jdbc.JDBCDriver", "jdbc:hsqldb:mem:sqlcontainer", "SA", "", 2, 2); SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", Arrays.asList("ID"), connectionPool)); Table table = new Table("People", container); } catch (SQLException e) { // Handle error e.printStackTrace(); }
try { connectionPool = new SimpleJDBCConnectionPool( "org.hsqldb.jdbc.JDBCDriver", "jdbc:hsqldb:mem:sqlcontainer", "SA", "", 2, 2); FreeformQuery query = new FreeformQuery("SELECT * FROM people", Arrays.asList("ID")); query.setDelegate(myFreeformQueryDelegateImplementation); SQLContainer container = new SQLContainer(query, connectionPool); Table table = new Table("People", container); } catch (SQLException e) { // Handle error e.printStackTrace(); }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Bug fixes
- Released
- 2011-05-06
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.0+
- Vaadin 6.6+ in 1.1.0
- Browser
- Browser Independent
Vaadin SQLContainer - Vaadin Add-on Directory
Vaadin SQLContainer is a container implementation that reads it's contents from a JDBC data source.Discussion Forum
Author Homepage
Simple Demo
Issue Tracker
Source Code
Vaadin SQLContainer version 0.8
Version 0.8 is feature complete. Please report any bugs found at http://dev.vaadin.com/newticket and they will be fixed for version 1.0.
Vaadin SQLContainer version 0.9.0
Bug fixes, API enhancements, SQLContainer is now Serializable, both FreeFormQueryDelegate and TableQueryDelegate use PreparedStatements, allow easy joins between SQLContainers, enhanced Oracle database compatibility, etc. See http://dev.vaadin.com/query?status=closed&group=resolution&milestone=SQLContainer+0.9 for details.
Vaadin SQLContainer version 1.0.0
Code review and minor fixes.
Vaadin SQLContainer version 1.0.1
Bug fixes
Vaadin SQLContainer version 1.1.0
Completely rewritten filtering system based on the new filtering API in Vaadin 6.6.0. This means that this version cannot be used with older versions of Vaadin.
Version 1.0.1 of SQLContainer can still be used with versions prior to Vaadin 6.6.0