Well the code is already covered (see my earlier link to the Oracle JDBC documentation - this included examples).
As for connecting via eclipse: as Mark has already written in your cross post, choose yourself a suitable database plugin (see here) and follow the documentation. If you get stuck, feel free to ask questions here, but without a more specific question we can't really give a more specific answer.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com