原创 正則 選取 匹配 內容 參與 替換

需求:需要將“#{creatorId}”替換爲“#creatorId#”。 方法:在Notepad++或Eclipse文本編輯器中,打開查找替換,選擇用正則查找,匹配表達式爲“#\{(.*?)\}”,替換表達式爲“#\1#”。  

原创 JTable 清空 內容的簡便方法

網上搜了幾個方法,感覺不太理想,研究了一下API,發現這個方法可能是最直接,最簡便的。 [code=Java] <p> for (int i = jTable.getColumnCount(); i > 0; i--) {    Str

原创 Spring HibernateTemplate 無法提交數據庫的解決辦法之一

原因可能是spring對於proxool連接配置不支持自動提交, 必須在hibernate.cfg.xml中添加一個自動提交的配置: <property name="connection.autocommit">true </proper

原创 Mock InjectMocks ( @Mock 和 @InjectMocks )區別

之前一直對這兩個註解的區別不是很明白。 搜到過一篇博客園的文章舉例說明了代碼行爲的區別。後來在stackoverflow上看到一個問答簡單明瞭的解釋了這兩個註解在定義上的區別: 在此翻譯記錄一下: //譯文Begin: @Mock: 創建

原创 Oracel查詢表中某字段值爲去重後第幾的記錄

自己的一點心得,記錄一下。 select distinct sal from emp order by sal desc; select sal, rownum rn from (select distinct sal from emp

原创 ThinkPad 雙顯卡 NVidia + 集顯 切換

桌面右鍵或者不管怎麼弄打開NVIDIA Control Panel: Manage 3D settings

原创 如何在MyEclipse 8.5 中導入Oracle jdbc driver?

搜了半天沒有找到真正有用的教程,自己琢磨半天終於有一種辦法了: 在項目上右擊 -- Profile As -- Profile Configurations... -- 左側選中項目 -- 右側選中 Classpath -- User

原创 TesgLog

package util.log; import java.util.Calendar; import java.util.Date; public class TesgLog {/*** @param args*/public stat

原创 notify() and notifyAll():

notify() and notifyAll(): notify() wakes up one thread and releases the lock. It is to send wake-up co

原创 pl sql developer 中文亂碼問題設置NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK解決

NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK 如有必要,再加一個: LANG=zh_CN.GBK

原创 CSDN的積分好像有難度

不知道發貼會不會獎勵積分。。

原创 Backward Slash Repalcer

HaHa

原创 java JTable 中設置沒列的寬度

看了不少JTable中設置列寬的方法,有的寫了三個類來實現。(不過可能我還沒來得及仔細領會其中的奧妙。) 總覺得設置列寬應該是一個很常用的方法,官方API不應該不提供。 果然,總算找到一個方法,就是分別設置各列的最大或者最小寬度: [

原创 Backward Slash Repalcer 2

<!DOCTYPE html> <html xmlns="http://www.w3.org/xhtml/9999"> <head> <meta http-equiv="Content-Type" content="text/html;