Progress on PMD issues (unused variables and related bugs).
Refactoring to reduce complexity of getAdapterFromConnectionString().