If your database provides a REST API for remote connections, then it should not be any problem. If you can access your database by using Sockets (i.e. java.net package) then this is not possible.
Also, Google App Engine provides free quota based on usage and not time. For more information please take a look at App Engine Quotas