Actually, you do need sql for this.

INSERT into Subscriber (SubscriberType,  LoginId, Password) VALUES( 'E',
        'jim',
        'jim')
select @@IDENTITY


This will return the value of the identity column on insert.  I know this
works under Sybase.  Mileage may vary.
--Angus
Travis Reeder wrote:
>
> What's the best way to get the id from the identity column after you just
> made an insert and ensuring that you get the correct one?  I don't want to
> know about the SQL syntax, but rather, is there a way to lock the database
> to make sure you get the right one?  Or is there some better way that
> doesn't require locking?
>
> Travis Reeder
> Director, Internet Technologies
> Xabre.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to