SQLite connection status in iOS

Is there a way to check the status of a SQLite DB connection in iOS. I do not want to continue to open the db connection again and again. As a job, I put the SQLite DB object in a static variable and checked if the object is NIL, otherwise use the object as is.

Is there an easier and clearer way to do this?

+3
source share
4 answers

Many SQLite Wrappers for iOS provide this functionality. Here is the library I wrote to handle SQLite joins that you can use to check the status of joins: https://github.com/ziminji/objective-c-sql-query-builder

+1
source

, FMDB SQLite.

: . , , "" . , , .

0

www.github.com/pmurphyjam/DBExample Xcode, SQLite. SQL , SQL-. . SQL FMDB, . : NSMutableArray = GetRecordsForQuery: @ " firstName, lastName , lastName =?", @ "Smith", nil];

,

BOOL = ExecuteStatement: @ " Company (firstName, lastName) (?,?)", @ "John", @ "Smith", nil];

0

There is an example project for using SQLite, which you can link to: https://github.com/AaronBratcher/ABSQLite

It has classes for accessing SQLite in a more traditional database mode.

-1
source

All Articles