JB + Oracle + WebLogic CMP uses self-growth primary key

xiaoxiao2021-03-06  96

1. Create a sequence example in the database: Create Sequence SUNTEST; 2. Create a table: Create Table SUNTEST2 (ID Number (9) Primary Key, Name Varchar2 (20), Email Varchar2 (40)) 3. Convert the table with JB to cmp // No need to say 4. The primary key of selecting CMP SUNTEST2 in EJB Desinger has an in ejbcreate () that does not change to false this will generate an ejbcreate () 5 without primary key parameters. Change WebLogic-Cmp-RDBMS-JAR.XML in and Add Oracle suntest 1 This WebLogic will automatically find the next value 6 when you call the EJBCREATE method. Configuring data sources on WebLogic // No need to say it. Deploy, test ----------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- ------------

Previously, this problem plagued my long-lasting solution was to create a method from the database from the database, and then sent to me Ejbcreate. When the parameter is a serious problem, it is my sequence from the database. The value method did not follow J2EE architecture ideas and manipulated the database directly. It is solved today, a word "cool". So write to me, I have this confused friend.

Welcome everyone to refer!

转载请注明原文地址:https://www.9cbs.com/read-104762.html

New Post(0)