Hi Ivan

At 20.05 13/03/2004 +0100, you wrote:
Hi All,

I'm on the same problem of reading an autogenerated ID from a sequence on
a Postgresql datatabase.

Shawn suggested me to use preUpdate and postUpdate to read fields for the
current row.

Can I use a method like "getField" from postUpdate interceptors to read an
autogenerated field from the database?

I'm not sure to be right but if I couldn't get the fieldvalue from the
postUpdate method the only way is to something like this process:

1) in preUpdate method I have to store in a Session variabile all the
fields except the autogenerated ID (generated from DBMS)...
   [BUT COULD I USE SESSIONS FROM AN INTERCEPTOR??]

[cut]


Yes you can and it's very simple: in preUpdate method:

HttpSession session = request.getSession();
session.setAttribute("attributeName", attributeValue);

and in postUpdate method:
HttpSession session = request.getSession();
String attributeValue = (String) session.getAttribute("attributeName");

I hope this will help you :)
Viviana



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to