, HSQLDBhsqldb HSQLDB is an unique high performing, high quality Java based relational database which can be very easily extended with simple Java static functions. , HSQLDBhsqldb是一個獨特的高性能,高品質的基於Java的關係數據庫,可以很容易擴展與簡單的Java靜態的職能。 Here we will see how you can easily extend the database capability with a real-life example.在這裡我們將看看如何您可以很容易地擴大數據庫的能力,與現實生活的例子。

I wanted to do a case-insensitive LIKE comparison, specifically get rows where the column data contains the target string.我想這樣做不區分大小寫想比較,特別是獲得行所在的列數據,包含目標字符串。 The where clause using LIKE would be: “Column Name” LIKE ‘Target String’. WHERE子句中使用的一樣,會說: “欄的名稱”想'的目標字符串' 。

Unfortunately SQL LIKE is case sensitive.不幸的SQL一樣,是區分大小寫的。 A simple way to accomplish this would be write a static function to do the comparison.一個簡單的方法來完成這項工作將寫一個靜態的功能做比較。 He is the function I wrote in my Util.java file (a collection of static java utility functions) to do the comparison:他的職能是不是我寫的在我util.java文件(收集了靜態Java的效用函數)做比較:

public static boolean containsMatch(String target, String search) { 公共靜態布爾containsmatch (字符串對象,字符串搜索) (
return target.toLowerCase().contains(search.toLowerCase()); 返回target.tolowercase ( ) 。包含( search.tolowercase ( ) ) ;
}

To use it I executed the following SQL query:使用它i執行以下SQL查詢:

select distinct "e-Biz Manager" from Sheet where "com.taragana.myexcel.Util.containsMatch"("e-Biz Manager", ‘emily’) 選擇獨特的“電子商業經理”從資產負債表“ com.taragana.myexcel.util.containsmatch ” ( “電子商業經理” , '劉慧卿' )

Note that I enclosed the function invocation in double quote.注意,我封閉的功能調用在雙引號。 The column name is enclosed in double quotes because it contains space.欄的名稱是包含在雙引號,因為它包含了空間。 The actual data is enclosed in single quotes.實際數據是包含在單引號。
Also note that I can shorten the name of the function invoked with an alias statement.還注意到,我可以縮短名稱的功能,引用與別名的聲明。

Isn’t this simplicity defined?難道這不是簡單界定? I find HSQLDB an extremely versatile database which has served me over the years, highly recommended.我覺得, HSQLDBhsqldb一個非常靈活的數據庫,其中已送達我多年來,高度推薦。 And as for performance?至於表現? It beats any other database hands down including but not limited to MySQL, Oracle etc.它擊敗任何其他數據庫的雙手向下包括但不限於到MySQL ,甲骨文等。