json文件怎么保存到sqlite数据库,将详细点,给高分!!!
发布网友
发布时间:2022-04-26 20:20
我来回答
共2个回答
热心网友
时间:2023-10-28 15:26
文件比较小就保存json字符串,文件很大就将文件路径保存至数据库。
热心网友
时间:2023-10-28 15:26
FOR EXAMPLE :
INSERT INTO mydatabase(NAME,ID) VALUES(
"[{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4",
"key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"},
{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4",
"key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"}]",
ID);
NSString *statement = [[NSString alloc]initWithFormat:@"INSERT INTO mydatabase(Name,ID) VALUES('%@',%d)",Name,ID];追问代码啥意思,完整点说一下
追答存入数据库的的语言啊,第一部分是数据库存入的语言,那个你不知道??
热心网友
时间:2023-10-28 15:26
文件比较小就保存json字符串,文件很大就将文件路径保存至数据库。
热心网友
时间:2023-10-28 15:26
FOR EXAMPLE :
INSERT INTO mydatabase(NAME,ID) VALUES(
"[{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4",
"key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"},
{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4",
"key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"}]",
ID);
NSString *statement = [[NSString alloc]initWithFormat:@"INSERT INTO mydatabase(Name,ID) VALUES('%@',%d)",Name,ID];追问代码啥意思,完整点说一下
追答存入数据库的的语言啊,第一部分是数据库存入的语言,那个你不知道??