same db connection on more pages

In my project I need to connect to the same database from different pages. Should I make a new connection in each page or there is a way to keep the connection active?

You should make a new connection, better would be to let the Servlet Container manage the connection via a Connection Pool, it is generally considered bad to leave connections open like you want to use…

look at
or search google for “Resource Injection javaee” and how to configure a Connection Pool for your Servlet Container/Application Server that you can use as a resource…

NOTE : If you REALLY need to keep the connection active, it is possible to leave a connection open/active, but then you should store it in the VaadinSession/Servlet session and this will most certainly prevent your session from serializing. ( aka your application can no longer scale in a Clustered environment )

OK Petrus, really thank you.