I think a good way is to split application presentation and logic.
Application presents only data, that are retrieved using public exposed functions as may be web services or API, or whatever logic you want which is following a Façade_pattern (service facade or session facade).
This can be easily obtained by using for example RMI or EJB. In the logic part you connect to database/xml on disk/your phone/whatever, but this will be done on a machine which is not reachable from outside, if not for remote calls.
Between your client(presentation which can be a java program, a web site, a phone application) and the logic(which is on your server) there may be a firewall or what ever protection you want. By the way on server side you can encrypt data in your EJB(which accesses the database), but it won't be shown externally.
I mean that's the good part of not knowing how things are implemented, the client doesn't know what the remote methods is doing, it just takes data back and that's all.
I think that expanding a bit this concept it may work, this is just a rough idea.