JAVA-1020: Merged the DB name validation from 2.x pull request.