Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Access to remote Text file via a URL

Help
deadl0ck
2013-06-13
2014-01-19
  • deadl0ck
    deadl0ck
    2013-06-13

    Is there a way of accessing a text file (read only of course) via a URL ?
    I'd like to create a HSQLDB interface to some open data CSV files without having to copy them locally.

     
  • Fred Toussi
    Fred Toussi
    2013-06-13

    No.

    Even if we could read from a URL, this would have performance issues. The file is read once to create the indexes, then each time a row is required, a random access read takes place to read the row data on demand.

     
  • deadl0ck
    deadl0ck
    2013-06-13

    OK - Thanks !
    One other question - does HSQL keep track of the size or timestamp of a linked to local text file (in case it's contents change and it needs to recreate the indexes) ?

     
  • Fred Toussi
    Fred Toussi
    2013-06-13

    You should not change the contents of a linked text file.

     
  • deadl0ck
    deadl0ck
    2013-06-14

    You should not change the contents of a linked text file.

    Fair enough - but if contents are changed externally to HSQLDB, will it rescan them, or should I drop the table and recreate it and relink the file to pick up changes ?

     
  • Fred Toussi
    Fred Toussi
    2013-06-14

    I repeat: "You should not change the contents of a linked text file".  If you do, you can expect mulfunction or crashes.

    You use SET TABLE .. SOURCE { OFF | ON} to link or unlink the file. While unlinked, you can change the contents of the file. When linked again, the entire file will be read.

     
  • deadl0ck
    deadl0ck
    2013-06-14

    Great - thanks for that !