You attempted to register a callback function before you connected to a database server. You must first connect to a database server and then register your callback function.