Hi,
Learn JDBC API, that's the answer of your question.
This API helps you communicate with whenever type of database you want (Access, MySQL, Oracle, PostgreSQL), but the database vendor must provide a jdbc driver so that you may use it.
Go to java.sun.com to know much more
Good luck,
Hamidou