implemented database handling for the chat application: chat records can be inserted and read back.