2

I've found numerous posts about reading CSV with Java and the APIs they were pointing at all had a line-oriented approach when it came to reading a CSV file. Something like "while you get a line, get the values of every column".

I'd appreciate a higher-level API, like in Perl where DBI allows you to use SQL on CSV like if it where a DB table. Otherwise I'll have to implement lots of access logic by myself.

Is there such an API? Am I missing something? There are some references about JDBC drivers but most are projects that haven't been updated the last 5 years.

4 Answers 4

2

You can use HSQL in order to do it, see the following links from the docs and a blog post describing exactly that.

Sign up to request clarification or add additional context in comments.

Comments

1

You could give H2Database a go - it is rather heavy weight, but at least it is maintained.

Comments

0

Are you trying to avoid using a regular database for accessing CSV? MySQL supports CSV as one of it's table types if you are open to using a database system.

Comments

-1

yes, JDBC with a CSV driver. You can try implement yourself or just try something like HXTT

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.