jb+oracle+weblogic cmp中使用自增长主键
添加时间: 2008-4-19 22:43:24 作者: Oracle指导 阅读次数:21 来源: http://www.d9soft.com
2.创建一个表 例:
create table suntest2
(
id number(9) primary key,
name varchar2(20),
email varchar2(40)
)
3。用jb把表转换成 cmp //不用细说了吧
4。在ejb Desinger中选择创建的cmp suntest2的主键 有一项 in ejbCreate() 无比改为false
这样就会生成一个没有主键参数的ejbCreate()
5.更改weblogic-cmp-rdbms-jar.xml
在<weblogic-rdbms-bean>和</weblogic-rdbms-bean>之间添加
<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>suntest</generator-name>
<key-cache-size>1</key-cache-size>
</automatic-key-generation>
这样weblogic在你调用ejbCreate方法的时候就会自动查找suntest这个序列得到下一个值
6。在weblogic上配置数据源 //不用细说了吧
7。部署,测试
上下文章:
上一篇文章: CCNA中文笔记-Access Lists 下一篇文章: CCNA中文笔记-Internetworking

