mysqlejbentity-bean

how to connect data base with EJB entity bean


how to configure EJB with mysql. where will put username,password , driver class etc...

i want access one table using EJB entity bean , it is installed in my local computer. how it is possble..

thanks and regards.....


Solution

  • I'll suggest the following:

    1. Use JPA to manage your database layer. You can use Eclipselink or hibernate to implement JPA.
    2. Create connection pool
    3. Inject EntityManager in Session bean
    4. From here you are ready to access database

    Hope that helps to kickstart.

    Sorry typing on phone so can't explain in detail.