如何使用Spring Boot将巨大的TSV文件导入内存数据库中的H2
我有一个巨大的tsv
文件,我需要将它们导入内存数据库中的H2。
我可以使用扫描仪
读取它,然后按行导入它,但需要几个小时!
是否有任何更快的方法将TSV文件导入内存数据库中的H2?
I have a huge tsv
files and I need to import them into my h2 in memory database.
I can read it with Scanner
and import it line by line but it takes for hours !
is there any faster way to import tsv file into h2 in memory database ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
插入选择转换
以直接从文件导入到H2表中。如何将CSV文件读取到H2数据库中:
或
h2 csvread函数
这些命令的场分离器。
Use
insert into select convert
for direct importing from file into your h2 table.How to read CSV file into H2 database :
Or
h2 csvread function
NOTE: You can specify file's field separator for these commands.