If you aren't familiar yet with
JDBC -the standard
Java API for accessing databases- then that's where
you should start. Do you know which DB you will be using?
As an aside, you should write POI code using the classes in the
org.apache.poi.ss package, not the *hssf* or *xssf* packages. That way the code can handle binary files as well as XML files.