I tested hsql with a table that has a 4000 character data field in HARRPTSQL, and for varchar2(4000) data fields it appears to work as it should.
However, I suspect where you’re hitting this limitation is with the BLOB data fields. I’ve seen the same thing.
The limitation is not the “varchar2” character limit, but the “raw” character limit. Raw data type can only hold 2000 characters. Therefore, you will need to extract 2000 characters at a time and concatenate the result.
Here’s where I found the limits for different data types: https://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF30020
Instead of using hsql, you might need to go directly to the database using SQL Plus or a pl/sql script. I am guessing that you’re using this to extract versions of text files from the HARVERSIONDATA table. If this is the case, you can use the HARVERSIONDATA.DATASIZE field to get the size of the file, then set up a loop to extract 2000 characters at a time and concatenate (or write) the results.