예제 #1
0
 void connection::close(){
     access_check();
     int err = sqlite3_close(handle);
     if(err != SQLITE_OK)
         throw database_exception_code(sqlite3_errmsg(handle), err);
     handle = 0;
 }
예제 #2
0
 void connection::open(const std::string &db, bool readonly){
   int err = sqlite3_open_v2(db.c_str(),&handle,
                 readonly?SQLITE_OPEN_READONLY:SQLITE_OPEN_READWRITE,
                 NULL);
       if(err != SQLITE_OK)
           throw database_exception_code(readonly
                     ?"Could not open read-only database"
                     :"Could not open database", err);
   }
예제 #3
0
 void connection::open(const std::string &db){
     int err = sqlite3_open(db.c_str(),&handle);
     if(err != SQLITE_OK)
         throw database_exception_code("Could not open database", err);
 }