I have a standalone application (no application/web server) with various methods accessing a database via JDBC. So far, a database connection is opened (and closed) in every method. There is no need for multiple connections at the same time.
But:
- Creating a new connection every time seems a bad idea because of performance
- Alternatively, using a single connection seems a bad idea as well.
What is the way to go? Connection pooling for just one connection?