Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:28:35+00:00 2026-06-07T05:28:35+00:00

I am passing the xml to my addRowToTheDatabase function . In this function i

  • 0

I am passing the xml to my addRowToTheDatabase function . In this function i simply parse the xml file and and retrieved elements to the xml file. Now I am testing this application. How can I test whether the row added in the database or not in from unit test case ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:28:38+00:00Added an answer on June 7, 2026 at 5:28 am

    // I manipulated one of my queries real quick.. I’m assuming you’re already connecting to a DB in SQLite, so much of this is un-needed. But this is the basic structure of a query.. as long as the DB resides in your application itself.

    -(void) basicQuery
    {
        @try {  
            NSFileManager *fileManager = [NSFileManager defaultManager]; 
            NSString *theDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"databasename.sqlite"]; 
            BOOL success = [fileManager fileExistsAtPath:theDBPath]; 
            if (!success) {
                NSLog(@"Failed to find database file '%@'.", theDBPath);
            } 
            if (!(sqlite3_open([theDBPath UTF8String], &database) == SQLITE_OK)) { 
                NSLog(@"An error opening database, normally handle error here.");  
            }  
    
            const char *sql = "SELECT * FROM TABLE"; // your basic query
            sqlite3_stmt *statement; 
            if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) != SQLITE_OK){ 
                NSLog(@"Error, failed to prepare statement, normally handle error here."); 
            } 
            while (sqlite3_step(statement) == SQLITE_ROW) { 
              NSString *value = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)]; 
               NSLog(@"value = %@",value);
    
            } 
            if(sqlite3_finalize(statement) != SQLITE_OK){ 
                NSLog(@"Failed to finalize data statement, normally error handling here."); 
            } 
            if (sqlite3_close(database) != SQLITE_OK) { 
                NSLog(@"Failed to close database, normally error handling here."); 
            } 
        } 
        @catch (NSException *e) { 
            NSLog(@"An exception occurred: %@", [e reason]); 
            return nil; 
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will be passing the xml file like this: File1.PostedFile.InputStream //reading xml file..... public
I understand this is not according to standard, however a partner is passing XML
I have a question in parsing XML. How can I parse out the value
I've used following code for parsing XML file in c++. http://www.codeproject.com/Articles/176236/Parsing-an-XML-file-in-a-C-C-program . Now I
I am passing an accountid as input from an XML file as shown, which
I am trying to parse some xml data by passing the variables with a
I am passing xml on my ajax request. i have this: var xml =
I am developing a web application and I am encrypting some XML and passing
I have an XML file that I am transforming via XSLT. I am passing
Is it possible to run testng from ant without passing a testng.xml file? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.