表 table 的 id 设为自增,请问用 sql 进行 insert 后,如何得到刚 insert 的 id 值?
表 table 的 id 设为自增,请问用 sql 进行 insert 后,如何得到刚 insert 的 id 值?
table
------------------------
table_id (自增) , name
reftable
------------------------
ref_id (自增) , ref_table_id
这时侯,对于批操作处理,往 table 中插入一条数据,同时往 reftable 中插入三条数据,其中 ref_table_id = table_id
以上操作要进行事务处理!
在 bean 的 update 方法中平常如何处理?(不考虑Hibernate的情况下)