標籤:一、事務的概念•事務指邏輯上的一組操作,組成這組操作的各個單元,要不全部成功,要不全部不成功.•例如: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題目: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 使用redis叢集配置,springredis上面兩篇介紹了redis叢集的配置合一些基本的概念,所以接下來當然是要在項目中使用咯,redis的java支援已經做的非常好了,所以我們來試著使用這些api來進行redis的操作,首先我們需要操作redis的架包: <dependency> <groupId>redis.clients</groupId>
在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();//