標籤:一、事務的概念•事務指邏輯上的一組操作,組成這組操作的各個單元,要不全部成功,要不全部不成功.•例如:A——B轉帳,對應於如下兩條sql語句update from account set money=money+100 where name=‘b‘;update from account set money=money-100 where name=‘a‘;資料庫開啟事務命令,其實事務是資料庫的概念•start transaction&
LeetCode,leetcodeoj題目:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.思路:吐槽這種題目,這就像你明明可以買到過年回家的直達票,有票且一鍵解決,卻去買分段票,路途不耽誤時間嗎?而且買分段票時中間容易出差錯(bugs),最終可能回不了家(運行結果錯誤)。package
LeetCode,leetcodeoj題目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may not modify
在Spring中配置Hibernate和單獨配置Hibernate的區別,springhibernate首先說下Spring和Hibernate的幾個特徵:Spring:自動依賴注入,類都可以被當成bean使用。Hibernate:會話工廠sessionfactory,交易管理員transaction。如果只使用Hibernate,那麼當你操作資料庫的時候,需要敲諸如:Configuration conf = new
LeetCode,leetcodeoj題目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. You may not alter the values
Java時間簡單操作,java操作使用java操作時間感覺真真蛋疼,還是我大C#舒服,一個DateTime全部搞定這裡的Date指的是java.util.Date擷取目前時間: // 建立一個目前時間的Date對象 Date time = new Date();蛋疼的地方,對時間增、減操作: // 使用Calendar類對時間增、減操作 Calendar c = Calendar.getInstance();//