Re: Accessing SQL Databases
Re: Accessing SQL Databases
- Subject: Re: Accessing SQL Databases
- From: Andrew Satori <email@hidden>
- Date: Mon, 15 May 2006 10:04:56 -0400
There are several options here, ODBC is just one.
Depending upon the environment you can use ODBC, however, this is a C
API and there are some header #DEFINE conflicts to be aware of when
using this API from OBjective C. Further, this does require a third
party ODBC driver to be installed. There are a few of them, I've
used the Actual Technologies one with some success, as well as
another that I'll address in minute.
If you are using Cocoa from Java, JDBC remains an option, and it's
the tool of choice for most of the various tools like Advenio's SQL
Grinder. Again, I've used it with success, though I found that
implementation and performance are issues. I suspect that this is
more of an issue with Microsoft JDBC driver than anything else, as I
had significantly better results with other JDBC implementations.
If you are using Mono and and Cocoa#, you have the
System.Data.SQLClient there, it works well, but the Cocoa# side of
the equation is still quite new and not as robust or tested as other
Cocoa solutions.
Finally, there is the Open Source alternative. FreeTDS works well,
though again, it is a C based API. FreeTDS offers both a library and
a free ODBC driver, though the ODBC driver is tricky to configure on
OS X, it does work, and performance is good (though not up to
Actual's). The library on the other hand flies. It's the fastest
throughput to SQL Server you'll find on the Mac. The downside, it is
GPL, and as such, if you publish your application with FreeTDS as a
dependancy, you are committing to GPL'ing your application as well.
If you can't tell, I've been down this path a couple of times
already :-). I personally find this to be one of the biggest
weaknesses in the OS X platform. Database access is simply not as
easy as it should be to woo corporate developers. Enterprise
Objects, Apple's WebObjects technology is uber cool, but it's not an
answer either, as it has a heavy learning curve and it doesn't play
nice with existing DB's that have clearly defined CRUD objects
designed on platforms that don't use EO's primary key generation
schemes.
What OS X needs along those lines is a simple 'ADO' like toolkit that
is bindings friendly, and supports multiple databases, either through
ODBC or something similar, though ODBC is established and drivers
exist so I would push that pretty heavily. Ideally, that toolkit
would be exposed to AppleScript as well. I've looked into doing it
myself, but there is no money in it, and I like to feed my family, so
I elected to go with projects that paid the bills instead.
On May 15, 2006, at 5:54 AM, Kenny Millar wrote:
Hello again,
Thanks to everyone who has helped me in the past - my socket stream
app and
my TimeLine app are coming along nicely.
I'm looking at writing a new app which needs to do some simple
queries to an
existing SQL database running on a Microsoft SQL Server on my local
lan.
The cocoa app would not need to update any of the tables, just
simply run
some queries to produce some stats. I don't need to create/modify or
maintain any tables, and I don't wish to run a database server on
my client
machine.
I've looked through the ADC site and searched for variations of
"SQL" and
"access sql tables" etc but cannot really find anything that tells
me what
my options are for accessing SQL databases.
So what are my options? Do I need some third party library to do this?
-Kenny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden