Replaced Class.newInstance call in ConnectToDatabase with
Class.getConstructor.newInstance call (for exception safety)