Backport JDBCConfig fixes and improvements: #308, #329, #335, #350, #369

As discussed on Mailing list