When you use a browser you need to execute an applet or servlet, or XML, etc. The JVM in the browser supplies the java environment. However you can have regular applications outside of a browser that are fired from the command line (or typically from an icon). These applications rely on the JRE (java runtime environment) for the environment. You make sure that the actual class that you call at the command line has a main() method in it so java knows where to start. The output is usually to the console, or the GUI that you provide (or to files of course). To do the database calls you use the ODBC:JDBC supplied by the vendor of the database. Java can call an Access database using the JDBC driver provided by Microsoft, the same with almost every well known database on the market today. Of course if you are clever, you can define and maintain the data with your own home built files and access class (but why re-invent the wheel, when there are SOOOO many good choices already out there).
"JavaRanch, where the deer and the Certified play" - David O'Meara