Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source iOS Objective-C Wrapper For Working With Microsoft SQL Server Databases

  •  
  •  
  •  
  •  
  •  

I’ve mentioned the FMDB library for easier SQLite usage, and CouchCocoa for working with CouchDB.

Here’s an open source iOS Objective-C Microsoft SQL server client library for iOS called SQLClient from Martin Rybak that makes it easy to connect to and utilize Microsoft SQL server-based databases.

SQLClient provides a wrapper for the C library FreeTDS library providing a nice simple Objective-C blocks based syntax.

Here’s a syntax example from the readme:

<pre>#import "SQLClient.h"

SQLClient* client = [SQLClient sharedInstance];
client.delegate = self;
[client connect:@"server:port" username:@"user" password:@"pass" database:@"db" completion:^(BOOL success) {
    if (success)
    {
      [client execute:@"SELECT * FROM Users" completion:^(NSArray* results) {
        for (NSArray* table in results)
          for (NSDictionary* row in table)
            for (NSString* column in row)
              NSLog(@"%@=%@", column, row[column]);
        [client disconnect];
      }];
    }
}];

//Required
- (void)error:(NSString*)error code:(int)code severity:(int)severity
{
  NSLog(@"Error #%d: %@ (Severity %d)", code, error, severity);
}</pre>
<pre>

You can find SQLClient on Github here, and read more about using the library over on Martin’s blog.

Thanks to Martin for the submission.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments