- (int)selectVlaueFromDB:(NSString *)rowName
{
int returnValue;
@try {
NSString *query = [[NSString alloc] initWithFormat:@"SELECT %@ FROM cache_flags WHERE (id = '%d')",rowName,1];
sqlite3_stmt
*statement;
int result = sqlite3_prepare_v2([mcDB
getOpenedDatabase], [query UTF8String], -1, &statement, nil);
[query
release];
if (result == SQLITE_OK) {
while (sqlite3_step(statement)
== SQLITE_ROW)
{
returnValue = sqlite3_column_int(statement, 0);
NSLog(@"slides %d", returnValue);
}
sqlite3_finalize(statement);
}else {
NSLog(@"Nexavar DataSource-
executeCacheSelectIsCacheAvailableForURL: Caught Error");
}
}
@catch (NSException * e) {
NSLog(@"Nexavar DataSource-
executeCacheSelectIsCacheAvailableForURL: Caught %@: %@", [e name], [e reason]);
}
@finally {
if ([mcDB isDatabaseOpened]) {
[mcDB closeDatabase];
}
}
return returnValue;
}