Issue #20842: Can't connect to external database with Qt5 - fix for all protocols.
Issue #20842: simpler code.
Merge pull request #5 from gadlim/master

Issue #20842: Can't connect to external database with Qt5.