如何从.sql文件复制数据的Java,Android的?文件、数据、sql、Java

2023-09-04 05:38:46 作者:一身温柔病

我有.sql文件 - 文件是从网站导出的数据。而我需要创建应用程序,它可以导入该文件以内部SQLite数据库。我可以创建简单的应用程序与数据库的工作,但我不知道是不是能够复制从SQL文件中的数据?由于.sql文件,其实是简单的脚本,所以我很困惑。告诉我,我该怎么办呢,请,谢谢。

I have .sql file - file is exported data from web-site. And I need to create application which can import this file to internal SQLite database. I can create simple application for working with database, but I don't know is it able to copy data from sql file in? Because .sql file is simple script in fact, therefore I'm confused. Tell me, how can I do it please, thank you.

推荐答案

您可以加载文件作为字符串(解析,如果包含不支持的命令很多块),由一个或多个语句(执行,如果您拆分SQL命令来很多部分)

You may load file as string (parse if that contain not supported commands to many blocks) and execute by one or many statements ( if you split sql command to many parts)

 
精彩推荐