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?
+1 for what Stephan said. In addition: as soon as your simple application finds that it needs to have two connections open at the same time (for example if you need to execute a second query before you've finished processing the first query) then your static-variable design is broken. You might then react by trying to modify that to have a static collection of connections, but again what Stephan said, it would be better to just use a connection pool. This has two advantages: (1) Somebody already wrote the code, and (2) It works already.
Another issue with your code (and maybe it's a shortened version just for an example to use here, I don't know): It doesn't use or even support PreparedStatement. It doesn't take long before a simple application finds the need to insert variables into a standard SQL query. You could write your own string-bashing code to do that, but you'll struggle with getting the quotes right, especially when you have to escape quotes in character fields. As your simple application expands you'll find that encapsulating standard-looking SQL code becomes more and more annoying to maintain. In other words the whole idea of a "DB" class which tries to encapsulate "DB" operations is rather suspect.