I've used the
JavaMail API to grab stuff from an e-mail account and process it. It worked quite well. Connect, process the mail, insert the stuff you want into the database via JDBC.
Note that the link is actually to a depricated API - while you can use it by itself, JavaMail is now part of J2EE.