Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:08:29+00:00 2026-05-28T17:08:29+00:00

I have an Application which displays a Chart, which is filled with data from

  • 0

I have an Application which displays a Chart, which is filled with data from an SQL table. I was looking for an possibility to let the user “Edit” the table so he can change the Chart. Today I found the Vaadin “SQLContainer” Add-on which is exactly what I need. I was able to connect to the Database and get the table I need and connect it to a Vaadin Table so I get to see a Database table inside Vaadin. I’ve read the Vaadin tutorial for SQLContainer (Updated AdressBook Tutorial) quite a few times but I still don’t get how to commit something to the DB via the SQLContainer. This is what I’ve got so far:

public void displayTable(){ 
    try {
        connectionPool = new SimpleJDBCConnectionPool(
                "org.postgresql.Driver",
                "jdbc:postgresql://localhost:5432/database", "username", "password", 2, 5);
        FreeformQuery query = new FreeformQuery("select * FROM table", connectionPool);
        container = new SQLContainer(query);
        container.addListener(new QueryDelegate.RowIdChangeListener() {
            public void rowIdChange(RowIdChangeEvent event) {
                System.err.println("Old ID: " + event.getOldRowId());
                System.err.println("New ID: " + event.getNewRowId());
            }
        });
    } catch (SQLException e) {
          e.printStackTrace();
    }
    table= new Table("Table",container);
    table.setSelectable(true);
    table.addListener(this);
    window.addComponent(table);
    }

}

I’m working with Vaadin Version 6.6.6 and I use PostgrSQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:08:30+00:00Added an answer on May 28, 2026 at 5:08 pm

    I see that your query is just “select * FROM table”. If this is the case, you should use TableQuery instead of FreeformQuery. TableQuery already has all read/write, sorting, filtering, etc implemented for the case that you are populating the container directly from a single SQL table.

    Using TableQuery, you should be able to set the vaadin table in editable mode (setEditable) and directly be able to manipulate values in the database, storing them by calling container.commit() unless it’s put in writeThrough and autoCommit modes. Or you can take one row of the table (one Item) and edit it in a Vaadin Form.

    If you need to use FreeformQuery (for more complex queries, e.g. JOINing two or more tables) you need to implement write support yourself, as already stated in another answer. For a simple example on this, check out the implementation of the DemoFreeformQueryDelegate for the SQLContainer demo applications.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a silverlight application which reads data from a db and displays them
I have an application which extracts data from an XML file using XPath. If
I have an application which displays data in a UITableView. However, it crashes when
I have developed an application which displays Hebrew strings that are retrived from a
I have an application which displays properties dialogs for various GUI-accessible objects. Because there
I have an XBAP WPF application which displays various pages inside of a Frame.
We have a Web application (ASP.NET) which displays in some page links to miscellaneous
I have an application which displays a collection of objects in rows, one object
I have a simple C# 2008 application which displays a png-picture and handles some
I built an application which displays the records from database in the window and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.