Added code to make sure we close the statement and the connection object
Prevent the code from exposing an internal implementation of Date.
Prevent tieing the internal Date with an external object reference
Prevents a couple of I/O errors due to new files not being deleted or
old files not being removed.
The code was incorrectly closing the connection to the Database.