Search code examples
javacsvjdbchsqldb

HSQLDB with multiple backing csv files


I need to bind a group of csv file in the format "YYYY-MM-DD hh:mm:ss.csv" that are present in the same folder with a unique table that contains all the data present in all the files.

I found how to bind one file but not how to bind multiple files, for example reading from here or here but I couldn't find anything about multiple backing files.


Solution

  • You cannot bind multiple files to one table. All the options for TEXT tables are documented here: http://hsqldb.org/doc/2.0/guide/texttables-chapt.html

    You can use separate tables. As you say the file names can change, you can write some Java code to periodically list the files in the directory and link the TEXT tables to the more recent files. See the SET TABLE T SOURCE ... statement.