Re: [Mysql-cocoa-users] SMySQL-Xcode example?
Brought to you by:
sergecohen
|
From: Aaron J. <aj...@ed...> - 2005-02-23 22:55:11
|
John, There's a VERY simple description of how to connect and do queries in the API documentation here: http://mysql-cocoa.sourceforge.net/SMySQL_doc/MCPConnection.html Then there's a description of how to use MCPResult here: http://mysql-cocoa.sourceforge.net/SMySQL_doc/MCPResult.html I think there's also a CLI_test program that comes with the framework. Aaron Jacobs On Feb 23, 2005, at 4:49 PM, John Mistler wrote: > I didn't get any responses from the previous post, so I'll assume that > I was > asking too much. Alternatively, could someone be so kind as to point > me to > an XCode example project that uses the SMySQL Framework to bridge a > MySQL > table and a visual representation of that table? I just need to get > an idea > of how the methods of the framework are utilized in .h and .m files. > > Thanks, > > John > > Previous Post: > > I am trying to integrate some Obj-C into my XCode app, which is > currently > exclusively written in Applescript. I use a MySQL database to supply > the > app with data for outlines and tables. With applescript I use the > following > to return a matrix of database entries: > > set theData to do shell script "/usr/local/mysql/bin/mysql -h > localhost -u > theUser -pthePassword -D 'theDatabase' -N -e \"SELECT columnOne, > columnTwo, > columnThree FROM theTable WHERE columnFour = '"&aVariable&"'\"" > > I then use applescript's text item delimiters to convert the matrix > into a > list of lists. > > Could someone give me an idea where to start, using the SMySQL > framework, in > issuing the same query in Obj-C? Some questions: > > 1. I am not sure I understand which header file(s) I need to #import > at the > top of my populateOutline.m file, if any? > > 2. Do I need to be using methods in the "MCPConnection.m" file to first > connect to the database, or is that taken care of some other way? If > "yes", > then do I call that/those method(s) each time I issue a query? > > 3. How do I know if the matrix I am returning is an NSDictionary or > NSArray...and how do choose the proper method out of the plethora in > "MPCFastQueries.m" and "MPCResult.m" that will return the same list of > lists > as in the applescript example? > > I know there is a lot I am asking here, but if I could get guidance on > these > issues then I will be able to use deductive reasoning to solve the > rest of > my issues in the future... > > Thanks! > > -John Mistler > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > |