永发信息网

sqlite可以存放pdf文件吗

答案:1  悬赏:20  手机版
解决时间 2021-11-24 01:28
  • 提问者网友:遮云壑
  • 2021-11-23 18:13
sqlite可以存放pdf文件吗
最佳答案
  • 五星知识达人网友:洒脱疯子
  • 2021-11-23 19:43
结果集的查询,需要用到SQLStatement对象。Statement对象表示一条SQL语句,可以理解为preparedstatement或者compiledstatement。一般使用sqlite3_prepare_v2()函数创建Statement对象。头文件中定义了2个成员变量:sqlite3*noteDB;NSString*databasePath;示例代码如下所示:-(void)initializeDataToDisplay{self.noteArray=[[NSMutableArrayalloc]init];constchar*dbpath=[databasePathUTF8String];sqlite3_stmt*statement;if(sqlite3_open(dbpath,¬eDB)==SQLITE_OK){NSString*querySql=[NSStringstringWithFormat:@"SELECtid,whattime,address,what,who,noteFROMNotebook"];constchar*query_stmt=[querySqlUTF8String];if(sqlite3_prepare_v2(noteDB,query_stmt,-1,&statement,NULL)==SQLITE_OK){while(sqlite3_step(statement)==SQLITE_ROW){NotebookInfo*notebookInfo=[[NotebookInfoalloc]init];notebookInfo.pk_id=sqlite3_column_int(statement,0);notebookInfo.whattime=[NSStringstringWithUTF8String:(char*)sqlite3_column_text(statement,1)];notebookInfo.what=[NSStringstringWithUTF8String:(char*)sqlite3_column_text(statement,3)];[noteArrayaddObject:notebookInfo];}}else{NSLog(@"Problemwithpreparestatement:%s",sqlite3_errmsg(noteDB));}//销毁Statement对象sqlite3_finalize(statement);}}将查询的结果存放在noteArray数组中,然后由TableView表视图显示数据记录。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯