Added null checks and isOpen method for jdbc datasource.