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.

FacebookTwitterDiggStumbleUponGoogle Plus

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

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *