Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4440
  • Last Modified:

Code example needed for COCOA Objective-C ODBC database access. 500 point question.

I need code that shows as simply as possible how to query a database via an ODBC connection using COCOA and Objective-C and put the results of the query in an array or text box.

What im trying to do is enter an employee number into a text box, query the db for that person, then update a field from the results. Also, I will more than likely put the results of all of the employees into a list box.

Simplicity is the key!
0
JasonOutlaw
Asked:
JasonOutlaw
1 Solution
 
brettmjohnsonCommented:
NeXT's DBKit was the original Obj-C ODBC interface in NeXTStep.  However, it was a 2-tiered model, was woefully inadequate, and was replaced with Enterprise Objects Framework (EOF).   Unfortunately when the OpenStep specification was written, EOF was pulled from the core frameworks and the technology was incorporated into WebObjects, where it remains today.   Unfortunately if you want to use Objective-C, you are stuck using WebObjects v4.  Later versions are Java only.  [A gross error on Apple's part, IMHO (but then I believe WO has been grossly mismanaged by Apple since the NeXT buyout).]
http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/About/chapter_1_section_1.html

Mac OS X 10.4 introduced CoreData, which supports database persistence.  AFAIK, the only database it currently supports is SQLite.  I imagine that some of the EOAdapter (drivers for individual databases) technology might be migrated to CoreData in the future, but I would not hold my breath.
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/index.html

Going outside Apple-supplied technology, there are several third party Obj-C ODBC packages available:
http://support.openlinksw.com/opie/kbase/print_opie_article.vsp?OP_ID=827
http://mac.sofotex.com/download-127862.html
http://www.iodbc.org/
http://www.ianywhere.com/downloads/whitepapers/ProjectBuilderJDBCContactSample.pdf
0
 
JasonOutlawAuthor Commented:
I found out a lot of this doing research while i was waiting on someone to give me an example.
What I found was if you install the iODBC framework from www.iodbc.org and download the carbon app example they have, it can very easily be ported to objective c. Thanks for the help.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now