Test database connection on startup