Search code examples
hsqldbresultsetuppercase

HSQLDB MySQL compatibility is rubbish


With reference to http://hsqldb.org/doc/2.0/guide/compatibility-chapt.html#coc_compatibility_mysql, the compatibility only solves half the problem. THE CAPITALIZED RESULTSETMETADATA (COLUMN NAMES) IS A PROBLEM! This complicates testing with the in-memory database when the MySQL is used in production. I have to sprinkle code in my controllers / verticles to check which database is used (test or non-test) and format the SQL query string by double-quoting the column names in the query.

Related post: Java common JDBC SQL Query strategy for Unit Test using HSQLDB and runtime using MySQL

Question: How to use lower-case column names or how to convert the capitalized RESULTSETMETADATA returned from HSQLDB to lower case?


Solution

  • Solution: Ditch HSQLDB and use H2 with database_to_upper=false option.