EJB design: Entity Beans with Autogenerated Primary Key for DB2 Database

  1. We are using Entity beans for persistence for IDM DB2 Database. The Primary Key in database is Autogenerated(Identity) column. I wanted to know how to persist the bean where the PK value is generated by Database and How to retrieve this value after creation. Thanks.
  2. Solution is not database dependent. It is appserver dependent. Which appserver you are using For example this is how it works in weblogic. http://edocs.bea.com/wls/docs81/ejb/DDreference-cmp-jar.html#1203428
  3. Hard luck. Check the link below http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/EJB_Container/1064344.html