Remove some deprecated uses of getConnection().
Fix tests.
Merge pull request #174 from csmith/gradle-pmd

Update PMD to 5.2.2.
Merge pull request #173 from csmith/master

Remove some deprecated uses of getConnection().
Fix some PMD errors.