Setup db and textfile permissions
Added db connection

write input/output to database