shashirajraja/onlinebookstore

[BUG]

Opened this issue · 0 comments

Description

When a databsae conncetion is made, the connection is not closed after its use. Further, that close call must be made in a finally block otherwise an exception could keep the call from being made.

Expected behavior

A final clause after the try-catch to close the database connection

Actual behavior

No final clause to close the database conneciton

Possible fix

Add a final clause to close the connection

Steps to reproduce

Selecting a book which calls the getBookById() method call that then creates a database connection

Context

Exception was thrown when querying book.

Additional information

No response