I have never connected to a database in java before. May I know if I should go about accessing a derby database with servlet?

I have checked this: [How do I access a database from my servlet or JSP?](http://www.jguru.com/faq/view.jsp?EID=161)
But I saw comments on the article saying that this is a bad way to connect. Could any one explain or show me the best way to that I should code to access my derby database?

Thank you very much.