database connection and dataSaving