A
Andreas Bauer
Hi,
I'm a bit stuck. I have three tables over which I want to spread let's
user informations. I have a table where I insert username, pwd. Then I
have a table with extended user info where I want to insert forename,
surname etc. But for this insert I'd need the id from the first insert.
Do I do this with sql or should I do an select right after the insert to
get the id?
sql = "insert into......"
ps.executeUpdate(sql);
sql ="select id from table where username = dd"
rs = ps.executeQuery()
while(rs.next())
{
int id = rs.getInt....
}
But this seems a bit circumstantial to me.
Any suggestions?
Regards,
Andi
I'm a bit stuck. I have three tables over which I want to spread let's
user informations. I have a table where I insert username, pwd. Then I
have a table with extended user info where I want to insert forename,
surname etc. But for this insert I'd need the id from the first insert.
Do I do this with sql or should I do an select right after the insert to
get the id?
sql = "insert into......"
ps.executeUpdate(sql);
sql ="select id from table where username = dd"
rs = ps.executeQuery()
while(rs.next())
{
int id = rs.getInt....
}
But this seems a bit circumstantial to me.
Any suggestions?
Regards,
Andi