How to parse database?