I am using HSQLDB 2.2.9 and am launching the server with a static script file containing INSERT commands with UTF-8 data for one of the memory tables. Data appears to be mangled when examined from the org.hsqldb.util.DatabaseManager tool.
Here’s how I start my server and the static data:
build.xml:
<target name="runServer">
<java classname="org.hsqldb.Server" fork="true">
<classpath refid="hsql-classpath"/>
</java>
</target>
static script:
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE PUBLIC.ORDERS(ORDERID INTEGER,SHIPCOUNTRY VARCHAR)
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10
SET SCHEMA PUBLIC
INSERT INTO ORDERS VALUES( ... UTF-8 DATA ...
If you are using your file.scipt file as the database’s .script file, it won’t work.
The .script file of the database is not generally for the user to modify. It is written and read by the database. The character encoding is a special form of escape sequence.
You can use HSQLDB’s SqlTool to parse and execute scripts.