Sahiru Gunawardene

Greenhorn
+ Follow
since Jan 11, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sahiru Gunawardene

The question I have is relatively simple, but being slightly new at Java, its confusing to find the right answer:
In the case of an extremely simple single user standalone java application, are static connection variables still considered bad practice?



For example, using the Connection variable C in the above DB class to connect to the database across the application.

Another small question I have is,
Again in the case of a simple, single user application, will keeping the connection open (instead of closing DB.closeConnection()) have any undesirable consequences?

Many thanks