I know HSQLDB could take csv as the data storage via text table. But I could not find the Excel solution.
As we know, we can attach a csv file using:
set table XXX source "data.csv"
with my implementation, we can use:
set table XXX source "data.xls;rowcount=10;colcount=11"
to attach a excel file. you have to tell how many columns exactly. and for rows, if you are not sure, just give a enough big number.
The idea is simple, first I wrote a class org.hsqldb.persist.ExcelToCsv to read a excel and save it as a csv with the same file name. Then I changed file org.hsqldb.persist.TextCache, when a file with .xls extension comes, use the class the parse excel to csv.
Excel data is read only, any modification will only affect csv file, but do not write back to excel. It's what I need, all I want is just query.
Log in to post a comment.