I'm trying to import some extra data to my existing H2 database. The extra data are in a .CSV file and I'm using the simple example SQL statement from H2 tutorial documentation:
SELECT * FROM CSVREAD('test.csv');
So far, I can only get the following exception:
Error: IO Exception: "IOException reading test.csv"; SQL statement:
SELECT * FROM CSVREAD('test.csv') [90028-176]
SQLState: 90028
ErrorCode: 90028
I am using SQuirreL client in Windows 7 to manage a local H2 database and so far, everything is working well. The test.csv
is in the same directory as the database file.
Looks like a problem with the test.csv
file. Is this on Linux ? Then check for case-sensitive file name and access permissions for the running process.
Could you read the file with FileInputStream
from your code ? Is this a remote H2 db ?
In any case, it is the H2 server that needs access to the file. Probably the file is not in the CWD of the H2 process. Try to specify an absolute file name for the H2 server like /my/folder/test.csv or c:\my\folder\test.csv.