There are no errors when using hibernate, because it closes the connection and creates a new access to each

The error occurs only when using JDBC:...