Tip: How To Extend HSQLDB RDBMS With Java Functionsヒント:どのようにJava RDBMSのより多くの機能を拡張するHSQLDB -
HSQLDB is an unique high performing, high quality Java based relational database which can be very easily extended with simple Java static functions. HSQLDB -舞台は、独特の高い、高品質のJ avaベースのリレーショナルデータベースを簡単に拡張することが非常に単純なJ avaの静的な機能です。 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:を使用すること私は、次の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. HSQLDB -私、非常に多彩なデータベースの検索サービス私は長年に渡り、強くお勧めします。 And as for performance?そしてパフォーマンスですか? It beats any other database hands down including but not limited to MySQL, Oracle etc.他のデータベースを手にビートダウンを含むがこれらに限定されるMySQLでは、オラクル等
Filed under提出されて Databaseデータベース , 、 Enterprise Softwareエンタープライズソフトウェア , 、 HSQLDB HSQLDB - , 、 Headline Newsニュースの見出し , 、 How Toどのように , 、 Java Software Javaソフトウェア , 、 Programmingプログラミング , 、 RDBMS RDBMSのより多くの , 、 Tech Note技術のノート | |
| |
RSS 2.0 RSS 2.0を | |
Trackbackトラックバック this Article |この記事|
Email this Article電子メールこの記事
You may also like to readを読むようにすることも可能 |




