Use a stored procedure.  They make your life on the servlet side a lot
easier.

Cheers!
Mark

----- Original Message -----
From: "robert young" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 8:28 PM
Subject: OFF-TOPIC: using JDBC to update parent/child tables


> [since there is no JDBC e-mail group, i'll try here]
>
> i need to use JDBC (dynamic SQL, not stored procedures),
> to insert a parent table row, then one or more child
> table rows where parent table Id is written into a
> column (e.g. ParentTableID) in the child table rows,
> thus supporting joining the two tables.
>
> while i can do this with ease using a bulk update where
> i can generate the id's as variables without reference
> to the underlying tables, i need to do this at the request
> of a servlet, getting data passed in.  i'm using db2, which
> can produce an integer primary key on the fly.  the passed
> in data from the servlet is not sufficient to make a unique
> identifier for the parent table row, so i need to use
> either the db2 facility, or a managed control table.
>
> single table inserts aren't a problem with JDBC, but this
> related table stuff has got me flummoxed.
>
> thanx,
> robert young
>
>
______________________________________________________________________
_____
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to