A simple class for database and paging functions