简体   繁体   English

可以从JDBC中运行sqlite .import命令吗?

[英]Can one run the sqlite .import command from within JDBC?

Trying it gave me a syntax error on the ".". 尝试它给了我“。”的语法错误。

If not, is there another way of bulk loading data into a sqlite database with similar performance? 如果没有,是否有另一种方法将数据批量加载到具有类似性能的sqlite数据库? .import (from the command line) does in under a minute what inserts (wrapped in a transaction) do in over 20 minutes. .import(从命令行)在一分钟内完成插入(包装在一个事务中)超过20分钟的事情。

I tried using .import after reading Faster bulk inserts in sqlite3? 在sqlite3中读取Faster批量插入后,我尝试使用.import . I've tried all the other suggestions there except for virtual tables. 我已经尝试了除虚拟表之外的所有其他建议。

Thanks! 谢谢!

All the .blah commands are features of the sqlite shell only; 所有.blah命令都只是sqlite shell的功能; they can't be used from JDBC (or any other language embedding either). 它们不能用于JDBC(或任何其他语言嵌入)。 With a very large data import, it's OK to just run it separately (or in a subprocess, provided the parent is not processing any other transactions at the time). 通过非常大的数据导入,可以单独运行它(或者在子进程中运行,前提是父进程当时没有处理任何其他事务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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