tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin van Dijken" <mvdij...@madocke.nl>
Subject RE: SQL INSERT
Date Mon, 25 Aug 2003 12:47:55 GMT
Hey Lukasz,

This is generally speaking an issue of SQL databases. Not all databases have a mechanism for
creating keys this way and therefore also not for retrieveing the keys inserted this way.
AFAIK there is no SQL standard addressing this issue and therefore there probably won't be
any method of doing this in a JDBC standards compliant way. There are I think some ways of
doing this in a database-specific manner, so what database are you using?


Greetings,

Martin van Dijken

PS You might want to look into excellent techniques such as JDO or EJB's (I'd recommend JDO)
but they are for the more experienced programmer

-----Original Message-----
From: p@zdzior [mailto:pazdzior@interia.pl]
Sent: maandag 25 augustus 2003 13:52
To: taglibs-user@jakarta.apache.org
Subject: SQL INSERT


Dear Taglibs users,

I am erforming SQL insert statement using  JSTL tgalib:

   <sql:transaction dataSource="${test}">
      <sql:update var="InsertDriver">
        INSERT INTO REQUEST_OFFER (RO_FK_CUST_PHONENO, RO_TYPE
                                   VALUES (?,?)
        <sql:param value="${Customer.phone_no}"/>
        <sql:param value="SINGLE"/>
      </sql:update>
    </sql:transaction>
 
The REQUEST_OFFER table has an ID field which is autincrement unique key.
Is it possible to obtain the value of this filed just after insert using JSTL?
Something like getGeneratedKeys() java methd.
Or if it is impossible to do using JSTL how to do it using java scriptlet?

thank you very much for help,

regards,
lukasz




Mime
View raw message