简体   繁体   中英

java sql query on data imported from csv file

I am planning a Java program which is working with data in csv files which I will load into 2D arrays or a hash map or some other object. I am curious if Java has any library or anything that would permit the implementation of SQL statements to query subsets from internally stored data objects.

I am wondering if maybe the JBDC drivers that allow Java to connect with or control relational SQL databases can be applied to internal data objects.

Your best bet would be to use h2 with the inbuilt csv support. You can find more details here http://www.h2database.com/html/tutorial.html#csv . I like this approach since this allows you to query / manipulate the data in a way a jdbc statement allows you to.

还有一个JDBC驱动程序 ,使您可以直接使用SQL查询CSV文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM