When you setup the openfire on your server and if you face the database connection problem on your server than in many case the problem with the hostname. you need to use the hostname as “localhost” in case of database connection with your own server database.
Use hostname as domain or ip in case of remote database connection. otherwise you need to use localhost as hostname. so this issue will fix for sure.