2

My problem is that I can't connect to my sqlite database file using Vaadin. I always get a requested resource is not available error. What's wrong with my code?

private Container buildContainer() throws SQLException {
        SimpleJDBCConnectionPool connectionPool = new SimpleJDBCConnectionPool(
                "org.sqlite.JDBC", "jdbc:sqlite:e:/teszt.db", "", "");       


        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT users.name, departments.name"               
                + "FROM users"
                + "INNER JOIN departments ON users.department = departments.id",
                connectionPool));
        return container;
    }

1 Answers1

-1

When troubleshooting some connection issue buried in layers of abstraction, try to get right to the simplest possible version of what you are doing.

First, connect to the database without Vaadin to verify that the db server is running and the connection code is wrong.

If that works fine, then the configuration problem is on the Vaadin side. Try connecting without the special sql container. Just open a connection and place some text on the screen to proce success. Also try connecting without a connection pool.

Thorn
  • 4,015
  • 4
  • 23
  • 42