If you're accessing the database using
JDBC, the applet sandbox won't allow access even when the database is on the same server you loaded the applet from.
You can create a signed applet to enable the JDBC, but firewalls often block JDBC, so the preferred method is to do the JDBC on the server side and use HTTP tunneling to get the data out to the client.
Try doing a search in this forum. It's a common question.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.