当前位置: 技术问答>java相关
在ejb的entityBean中怎么实现sql server中的自增长字段的主键问题???/
来源: 互联网 发布时间:2015-10-17
本文导语: 请不要说再建一个储存键值表,请高手指点迷津??/ 在:db2 , oracle中有序列可以取的下个主键值,请问有没有统一的方法呢? | 用这个也可以::-) @@IDENTITY Returns the last-inserted identity...
请不要说再建一个储存键值表,请高手指点迷津??/
在:db2 , oracle中有序列可以取的下个主键值,请问有没有统一的方法呢?
在:db2 , oracle中有序列可以取的下个主键值,请问有没有统一的方法呢?
|
用这个也可以::-)
@@IDENTITY
Returns the last-inserted identity value.
Syntax
@@IDENTITY
Return Types
numeric
Examples
This example inserts a row into a table with an identity column and uses @@IDENTITY to display the identity value used in the new row.
INSERT INTO jobs (job_desc,min_lvl,max_lvl)
VALUES ('Accountant',12,125)
SELECT @@IDENTITY AS 'Identity'
@@IDENTITY
Returns the last-inserted identity value.
Syntax
@@IDENTITY
Return Types
numeric
Examples
This example inserts a row into a table with an identity column and uses @@IDENTITY to display the identity value used in the new row.
INSERT INTO jobs (job_desc,min_lvl,max_lvl)
VALUES ('Accountant',12,125)
SELECT @@IDENTITY AS 'Identity'
|
在你的weblogic-cmp-rdbms-jar.xml中应该这样写:
SQL_SERVER
并且,在create方法中不能有主键参数出现!搞定,有问题来信,
SQL_SERVER
并且,在create方法中不能有主键参数出现!搞定,有问题来信,
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。