Try to connect to Database when creating DBO

Try to connect to Database at the time creating DBO to verify database connection. It will fix the issue Joomla still returns "200" code when connection is lost, which reported in #1823 but not solved.