Currently my program establishes a connection to the server each time it needs to and closes the connection after it grabs what it needs.
Connection con = DriverManager.getConnection(url, user, pass);
//grab data
con.close();
Is it better or worse practice and what difference would it make if I just had one global connection running from the start of the program. Something like
public static Connection con = DriverManager.getConnection(url, user, pass);
And just referenced it wherever I needed it with something like
classname.con.createStatement();