I\'m using HikariDataSource
to connect to a MariaDB
database. The following class returns a Connection
.
public class DataS
You don't need to call DataSource's close() for every connection:
Shutdown the DataSource and its associated pool.
It's defined only for application termination:
close()
is essential at application termination
You should continue working with the pool, notice you are closing (correctly) the connection with try with resources
try (Connection connection = dataSource.getConnection()