I have this tutorial about making a library system but code is like opening the Connection and then after a few codes and commands it ends with a Close(); method is it really a need to close the connection then open it again whenever there's a new function?
For example in Login button there's this code that starts with connnection.open(); and ends with connection.close(); then in Search Button there's also this Open and Close methods....
is it really necessary to close the connection? why not just let it open and then close it when the program terminates?