Make the database connection string a parameter
Determine the execution mode by the parameter to main