users@glassfish.java.net

Re: Hwo to use Jpa on servlet

From: Sanjeeb Sahoo <sahoo_at_sun.com>
Date: Wed, 09 Jun 2010 18:19:56 +0530

On Wednesday 09 June 2010 04:01 PM, glassfish_at_javadesktop.org wrote:
> Thank you Sanjeeb,
> may I have two more questions.
> 1) Can I create the table on the db first then alow the user register by servlet by jpa?
>
Of course you can. Don't use createtable option during deployment and
ensure that the mapping you specify in the Java code correspond to rdbms
schema.
> 2) Jpa+ servlet /Jpa + ejb what is the advavatage and disadvantage?
>
Take JPA out of equation. Decide if you need to use EJB or not. I am
sure you shall find plenty of good articles on the subject. My short
answer is use EJB in your business layer and use something like JSF/JSP
in your presentation layer.

Sahoo