-1
我需要在table A
中插入記錄,更新table B
中的記錄,使用spring jdbc模板從java中刪除table c
中的記錄。我可以在單個sql查詢(一個網絡調用)中執行所有這些操作嗎?我使用的是oracle數據庫,java 1.8,Spring jdbc模板,spring版本4.2.6。如何在java中使用spring jdbc模板在oracle中插入或更新多個表中的記錄
我需要在table A
中插入記錄,更新table B
中的記錄,使用spring jdbc模板從java中刪除table c
中的記錄。我可以在單個sql查詢(一個網絡調用)中執行所有這些操作嗎?我使用的是oracle數據庫,java 1.8,Spring jdbc模板,spring版本4.2.6。如何在java中使用spring jdbc模板在oracle中插入或更新多個表中的記錄
我想你想在同一交易做三個SQL,您可以使用org.springframework.transaction.annotation.Transactional到控制器的回滾,請確保完成所有的操作在同一交易
@org.springframework.transaction.annotation.Transactional
public void executeSQL() {
insert records in table A
update records in table B
delete records in table c
}