If you control both servers, you don´t even would really need to use certificates, just setup on each side the trusted public key for the other side and use that to stablish a SSL/TLS like connection.
However, probably the easiest way of doing this is really using SSL/TLS and certificates, just because this is the only way you will be able to setup such a protected connection on most systems. But you do not need to buy a certificate on this case, it is okay to use self-signed certs, since you will not have too much real advantage on using a trusted CA to issue the certs. The matter here is just how good you protect the database side private key. If you have a self signed certificate or a CA signed certificate for that key, but you loose the private key, the effect is almost the same since the quickest way to mitigate it is removing the key trustworthiness on the application and replacing it for a new one (on a CA you could also ask for certificate revocation, but that would take more time to be effective).
What you need is to generate a self-signed cert for the database, and setup the database to use it. Then put this certificate as trusted on the application connection configuration.
Maybe you can do even better, if your database supports client certificate verification, you could have also a cert in the application that is trusted in the database. Therefore to connect and stablish a trusted connection one would need to have both client and server private keys. But Im not aware if any database supports it. If you provide details on the database you use, one might give more detailed answer.