Add getOptionalConnection.
Merge pull request #124 from greboid/optional-connection

Add getOptionalConnection.