Replace database connection