Does Vaadin 7 work with sqlcontainer?

Hi,
I used vaadin 6 to connect an interface to mysql database using sqlcontainer, and it worked perfectly :slight_smile:
However, i tried the same project with vaadin 7 and i get the error in the attached picture which complains about
“com.vaadin.server.ServiceException: java.lang.AbstractMethodError”
I read some topics in this forum which suggested some conflicts of earlier versions of vaadin in the classpath. I have checked my classpath but there are absolutely no conflicts of vaadin 7 with earlier versions of vaadin. I have also read about this error in other forums which have pointed to problems of vaadin 7 with sqlcontainer. Please may i have a clarification on this issue? thanks in advance
27909.jpg

You can usually see the compatibility information in Add-On Directory. An as in this case, SQLContainer states it is not compatible with Vaadin 7.

https://vaadin.com/directory#!addon/vaadin-sqlcontainer

Thanks for the response Tatu. May i please know the alternative for sqlcontainer in vaadin 7, please? For eg what would be the alternative for SQLContainer in the statement below: Thanks

// tablequery to connect to database and table names
TableQuery tq = new TableQuery(“userinfo”, connectionPool);

     try {
        
         //put tablequery tq in sqlcontainer

SQLContainer testContainer = new SQLContainer(tq);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

SQLContainer has been included in the framework since 6.7.0

Well Artur, i can see in this link below that SQLContainer is not compatible with Vaadin 7
https://vaadin.com/directory#!addon/vaadin-sqlcontainer

I may be wrong, if that is the case, please help me out to understand the problem i am having. Many Thanks.

Yes, the add-on is only for Vaadin 6. Since 6.7/7.0, you don’t need any add-on. Just use the classes included in the framework.

Please, i am new with vaadin 7, so please bare with me if i ask some basic questions. Please can you be specific and tell me which classes you are referring to for the sample code below:

// tablequery to connect to database and table names
TableQuery tq = new TableQuery(“userinfo”, connectionPool);

     try {
        
         //put tablequery tq in sqlcontainer

SQLContainer testContainer = new SQLContainer(tq);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

Do you have “vaadin-sqlcontainer-1.1.0.jar” in your project? If so, delete it

Also, you need to change the imports from com.vaadin.addons.* to com.vaadin.* if I remember correctly

You could check the documentation at
https://vaadin.com/docs/-/part/framework/sqlcontainer/sqlcontainer-getting-started.html.

The classes with full package names referred here are:

  • com.vaadin.data.util.sqlcontainer.query.TableQuery
  • com.vaadin.data.util.sqlcontainer.SQLContainer

ok, it works now :slight_smile:

i deleted the “vaadin-sqlcontainer-1.1.0.jar” as suggested by Arture Signell and then used the classes - com.vaadin.data.util.sqlcontainer.query.TableQuery

  • com.vaadin.data.util.sqlcontainer.SQLContainer

as suggested by Jens Jansson. Thanks you very much for the help.