Re: [Mysql-cocoa-users] MCPConnection upgrade
Brought to you by:
sergecohen
|
From: Aaron J. <aj...@ed...> - 2004-08-15 01:52:30
|
A couple of points. First, it looks like MCPConnection already does
this. From MCPConnection.m, in the queryString: method:
NSLog (@"Problem in queryString error code is : %d, query is :
%s -in ObjC : %@-\n", theQueryCode, theCQuery, query);
NSLog(@"Error message is : %@\n", [self getLastErrorMessage]);
// theResult = [theResult init]; // Old version...
theResult = nil;
Whenever I have an error, I get that output on the console.
Second, it seems like it would be much quicker to check for errors in
your code like this:
if ([connection getLastErrorID])
That just checks for a non-zero error ID, which I think will be much
faster than doing a string compare each time. That's how I do it in my
code.
Aaron
On Aug 14, 2004, at 4:17 PM, Camille GOUREAU-SUIGNARD wrote:
> Hi,
>
> I'm thinking about an implementation of MCPConnection, but I'm afraid
> to touch the framework source code.
> I usually need to have a detailed report about errors after each of my
> queries, so I add this code after all queries (till I'm sure they'll
> be OK in any circumstances) :
>
> if ([[connectMySQL getLastErrorMessage]
> compare:@""]!=NSOrderedSame) {
> NSLog (@"erreur MySQL !!");
> NSLog(@"query : %@", myQueryString);
> NSLog(@"error : %@", [connectMySQL getLastErrorMessage]);
> }
>
> Would it be possible (and easy to do by myself) to add a flag in
> MCPConnection : BOOL errorReport
> And when it's set to TRUE, to NSLog detailed reports after each error ?
>
> Can somebody point me where to look and how to do without ruining the
> code ?
>
> Thanks.
>
> Camille
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Mysql-cocoa-users mailing list
> Mys...@li...
> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users
|