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 es un único de alto rendimiento, alta calidad basado en Java base de datos relacional que puede ser muy fácilmente ampliado con simples funciones de Java estática. Here we will see how you can easily extend the database capability with a real-life example. Aquí vamos a ver cómo se puede ampliar fácilmente la capacidad de base de datos con un ejemplo de la vida real.

I wanted to do a case-insensitive LIKE comparison, specifically get rows where the column data contains the target string. Quería hacer un distingue entre mayúsculas y minúsculas LIKE comparación, específicamente obtener las filas donde la columna de datos contiene la cadena objetivo. The where clause using LIKE would be: “Column Name” LIKE ‘Target String’. La cláusula donde utilizando SIMILAR serían: "Nombre de columna" LIKE 'Objetivo String ».

Unfortunately SQL LIKE is case sensitive. Lamentablemente SQL LIKE distingue entre mayúsculas y minúsculas. A simple way to accomplish this would be write a static function to do the comparison. Una manera sencilla de lograr esto sería escribir una función para hacer la comparación. He is the function I wrote in my Util.java file (a collection of static java utility functions) to do the comparison: Él es la función que escribí en mi Util.java archivo (una colección estática de java funciones de utilidad) para hacer la comparación:

public static boolean containsMatch(String target, String search) { public static boolean containsMatch (String target, String búsqueda) (
return target.toLowerCase().contains(search.toLowerCase()); volver target.toLowerCase (). contiene (search.toLowerCase ());
} )

To use it I executed the following SQL query: Para usarlo I ejecutado la siguiente consulta SQL:

select distinct "e-Biz Manager" from Sheet where "com.taragana.myexcel.Util.containsMatch"("e-Biz Manager", ‘emily’) seleccionar distintas "e-Biz Manager" Hoja de donde "com.taragana.myexcel.Util.containsMatch" ( "e-Biz Manager", "cchinco ')

Note that I enclosed the function invocation in double quote. Tenga en cuenta que he cerrado la invocación a la función de doble cotización. The column name is enclosed in double quotes because it contains space. El nombre de la columna se escribe entre comillas dobles, ya que contiene el espacio. The actual data is enclosed in single quotes. Los datos reales se adjunta en comillas simples.
Also note that I can shorten the name of the function invoked with an alias statement. También tenga en cuenta que yo pueda acortar el nombre de la función invocada con un alias.

Isn’t this simplicity defined? ¿No es esta simplicidad se define? I find HSQLDB an extremely versatile database which has served me over the years, highly recommended. Me parece HSQLDB una base de datos muy versátil que me ha servido a lo largo de los años, muy recomendable. And as for performance? Y en cuanto a rendimiento? It beats any other database hands down including but not limited to MySQL, Oracle etc. Late cualquier otra base de datos de las manos hacia abajo incluyendo pero no limitado a MySQL, Oracle, etc