JDBC isn't part of J2ME. So there's no universal way. Even if there was, 2-tier applications are a menace, as SQL Slammer demonstrated. You can't even do JDBC in 2-tier mode from unsigned Java
applets, because it's such a security issue.
You might want to investigate setting up some sort of web service. Although it's not as convenient as the brute-force approach, it's more secure - besides insulating your backend database server direct outside attacks, you can use encrypted channels (https).
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.