Cleaned up complexity of connectDB in ResolveURI.  Also adapted code to
check if data source is already connected before recreating data source
connection.