You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thomas Dudziak <to...@gmail.com> on 2006/09/16 22:23:05 UTC

Re: Fetching Identity

On 9/16/06, sachin@mechsoftgroup.com <sa...@mechsoftgroup.com> wrote:

> I am using MS Sql server 2000 as database server.
> Primary key of table is generated using Identity.
>        How can we get currently generated identity?

After saving an object, its field that is mapped to the primary key,
should contain the value.
If you're sure that only one thread accesses the database, then you
could also use Sql Server specific SQL to get the value (via JDBC):

http://www.sqlteam.com/item.asp?ItemID=319

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org