mysql-cocoa-users Mailing List for MySQL Objective C API for Cocoa (Page 10)
Brought to you by:
sergecohen
You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
|
Mar
(14) |
Apr
(5) |
May
(23) |
Jun
(8) |
Jul
(13) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(11) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(9) |
Feb
(6) |
Mar
(13) |
Apr
(2) |
May
(3) |
Jun
|
Jul
(5) |
Aug
(11) |
Sep
(18) |
Oct
(1) |
Nov
(15) |
Dec
(2) |
2004 |
Jan
(3) |
Feb
(3) |
Mar
(8) |
Apr
(1) |
May
(2) |
Jun
(3) |
Jul
(15) |
Aug
(36) |
Sep
(5) |
Oct
|
Nov
(6) |
Dec
(2) |
2005 |
Jan
(1) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
|
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2006 |
Jan
(9) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
(9) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
2007 |
Jan
(23) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Lorenz T. <lo...@te...> - 2003-07-26 17:00:14
|
Hi John, Sorry for answering so late, but maybe it still helps! > I'm kinda new to cocoa: how exactly do you compile a framework? Just be sure that Project Builder finds all files. If a file on the left is red, the path is wrong. Select it and hit option+i to correct the path! Then select Build in the build menu and the framework will be compiled. You'll then find it in the build folder inside the framework project folder. If you want to add the framwork to your project, select "Project>Add Frameworks..." and search for the compiled framework. If you want to implement the framework in your application (so that users don't have to install the framework), select the Target tab on the left and select the main target. Then select Build Phases in the main view and "New Build Phase>New Copy Files Build Phase" from the menu. Select frameworks and drag&drop the SMySQL framework from the left to the copy files build phase. > Oh and another question: what does embedding and fully embedding do > to=20= > a framework? I think that in the fully embedding target all MySQL C files will be embedded in the framework. It will be bigger, but users do not need to install MySQL. But I'm not sure about that... Please let me know if you need more exact informations! Cheers, Lorenz |
From: eXtremeScripts <ma...@ex...> - 2003-07-25 11:21:05
|
Dear, friend! http://www.extremescripts.com/forum/index.php I would like to ask you to take some time and look at my webdesign help site just click the link above. We also have resource features for people who are new to webdesign. Right now the resource features are kinda empty but they will get more stuff added to them over time. Thank you for taking the time to read this. To be removed from this list please send an email to re...@ex... |
From: John D. <jd...@ta...> - 2003-07-15 14:58:32
|
I'm kinda new to cocoa: how exactly do you compile a framework? Oh and another question: what does embedding and fully embedding do to=20= a framework? - John D. On Tuesday, July 15, 2003, at 1:51AM, Camille Goureau-Suignard wrote: > Hi, > > I installed it quite a long ago ... > Did you compile the framework ? > You have to copy the content of the build directory in=20 > /library/Frameworks > Does it help ? > > Camille > > > Le mardi, 15 juil 2003, =E0 00:06 Europe/Paris, John Devor a =E9crit : > >> Hello, >> At the moment, I'm having some difficulty using/installing the=20= >> SMySQL frameworks. I was hoping somebody out there might answer a few=20= >> questions/requests: >> >> 1. I've checked the documentation (which is nicely formatted in=20= >> apple fashion I must say), but what is the difference between the=20 >> items using the S- and the MCP- extensions? They seem to be quite=20 >> similar in several regards (i.e. the documentation for the SMySQL,=20 >> and MCP- Connection seems to be almost identical). >> 2. To run/install the "SMySQL_Test" project, what exactly do you=20= >> have to do? I've put the framework in ~/Library/Frameworks and then=20= >> imported them from that directory into PB (well, Xcode, heh, ty=20 >> bittorrent). I think something must be wrong w/ the frameworks=20 >> because I seem to be getting some SMySQLResult and SMySQLConnection=20= >> undeclared errors. Any help in this regard? >> 3. Hrm. I thought I had another. Guess not. >> >> If somebody could assist me with these, I would be most grateful. : D >> >> - John D. >> >> >> >> ------------------------------------------------------- >> This SF.Net email sponsored by: Parasoft >> Error proof Web apps, automate testing & more. >> Download & eval WebKing and get a free book. >> www.parasoft.com/bulletproofapps1 >> _______________________________________________ >> Mysql-cocoa-users mailing list >> Mys...@li... >> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users >> > |
From: Camille Goureau-S. <ca...@lu...> - 2003-07-15 05:50:04
|
Hi, I installed it quite a long ago ... Did you compile the framework ? You have to copy the content of the build directory in=20 /library/Frameworks Does it help ? Camille Le mardi, 15 juil 2003, =E0 00:06 Europe/Paris, John Devor a =E9crit : > Hello, > At the moment, I'm having some difficulty using/installing the = SMySQL=20 > frameworks. I was hoping somebody out there might answer a few=20 > questions/requests: > > 1. I've checked the documentation (which is nicely formatted in = apple=20 > fashion I must say), but what is the difference between the items=20 > using the S- and the MCP- extensions? They seem to be quite similar in=20= > several regards (i.e. the documentation for the SMySQL, and MCP-=20 > Connection seems to be almost identical). > 2. To run/install the "SMySQL_Test" project, what exactly do you = have=20 > to do? I've put the framework in ~/Library/Frameworks and then=20 > imported them from that directory into PB (well, Xcode, heh, ty=20 > bittorrent). I think something must be wrong w/ the frameworks because=20= > I seem to be getting some SMySQLResult and SMySQLConnection undeclared=20= > errors. Any help in this regard? > 3. Hrm. I thought I had another. Guess not. > > If somebody could assist me with these, I would be most grateful. : D > > - John D. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > |
From: John D. <jd...@ta...> - 2003-07-14 22:06:39
|
Hello, At the moment, I'm having some difficulty using/installing the SMySQL frameworks. I was hoping somebody out there might answer a few questions/requests: 1. I've checked the documentation (which is nicely formatted in apple fashion I must say), but what is the difference between the items using the S- and the MCP- extensions? They seem to be quite similar in several regards (i.e. the documentation for the SMySQL, and MCP- Connection seems to be almost identical). 2. To run/install the "SMySQL_Test" project, what exactly do you have to do? I've put the framework in ~/Library/Frameworks and then imported them from that directory into PB (well, Xcode, heh, ty bittorrent). I think something must be wrong w/ the frameworks because I seem to be getting some SMySQLResult and SMySQLConnection undeclared errors. Any help in this regard? 3. Hrm. I thought I had another. Guess not. If somebody could assist me with these, I would be most grateful. : D - John D. |
From: Serge C. <ser...@us...> - 2003-05-22 16:45:02
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sorry I missed the previous post...=0D =0D You can as well use the method=0D - -(NSString *) stringWithText:(NSData *) theTextData=0D =0D from MCPConnection or MCPResult in this way:=0D =0D NSData* contentAsBlob =3D [lineRes objectForKey:@"theText"];=0D NSString* contentAsString =3D [lineRes stringWithText:contentAsBlob];=0D =0D The interest of this method is that it should be able to use a better =0D= (more proper) encoding, when you need to pass around characters out of =0D= the 7bit ASCII (accented characters...). For that it uses the encoding =0D= declared by the mysql server...=0D =0D Note that you can also change the second line to :=0D NSString* contentAsString =3D [theMCPConnection =0D stringWithText:contentAsBlob];=0D =0D It can be interesting if you get the blob without having access to the =0D= MCPResult but you still have access to a MCPConnection connected to the =0D= proper server.=0D =0D Last note, the encoding present for MySQL and from Apple does not =0D match... So in the current implementation I'm trying to use the Apple =0D= encoding closest to the one from MySQL. This mean that certain MySQL =0D encoding are not Ok (no Apple correspondance), some other are =0D incomplete...=0D =0D =0D Serge.=0D =0D =0D Le jeudi, 22 mai 2003, =E0 16:51 Europe/Amsterdam, John Guy a =E9crit :=0D= =0D > Sorry for the delay in getting back on this,=0D >=0D > I replied to a similar question a while ago, but basically if the =0D > column texte is in fact a BLOB, then what you will get back from the =0D= > query is NOT an NSString, but an NSData object.=0D >=0D > If you know that the NSData object actually contains string data then =0D= > you can extract a string from it using the raw data with an encoding =0D= > as below=0D >=0D > NSData* contentRawBlob =3D [lineRes objectForKey:@"value"];=0D > NSString* contentText =3D [[NSString alloc] = initWithData:contentRawBlob=0D > = encoding:NSASCIIStringEncoding];=0D >=0D >=0D > Hope this helps=0D >=0D > JOhn=0D >=0D >=0D >=0D > On Tuesday, May 20, 2003, at 05:38 AM, Camille Goureau-Suignard wrote:=0D= >=0D >> Hi,=0D >>=0D >> did anybody manage to retrieve a blob ?=0D >>=0D >> with string : "marotte ange"=0D >> chaine2 =3D [NSString stringWithFormat: @"insert =0D >> commentlong (texte) values (\"%@\") ;", [cnxCommentaireLong =0D >> stringValue]] ;=0D >>=0D >> it gives in MySQL :=0D >> mysql> select * from commentlong ;=0D >> +----+--------------+=0D >> | id | texte |=0D >> +----+--------------+=0D >> | 1 | marotte ange |=0D >> +----+--------------+=0D >> 1 row in set (0.05 sec)=0D >>=0D >> But when retrieving it it gives :=0D >> SMySQLResult *result2 =3D [connectMySQL queryString: =0D= >> [NSString stringWithFormat: @"select texte from commentlong where id =0D= >> =3D %@ ;",[ligne objectForKey: @"id_commentlong"]]] ;=0D >> [cnxCommentaireLong setStringValue: [[result2 =0D >> fetchRowAsDictionary] objectForKey: @"texte"]] ;=0D >>=0D >> <6d61726f 74746520 616e6765 >=0D >>=0D >> any idea ?=0D >>=0D >> Thanks.=0D >>=0D >> Camille=0D >>=0D >>=0D >>=0D >> -------------------------------------------------------=0D >> This SF.net email is sponsored by: ObjectStore.=0D >> If flattening out C++ or Java code to make your application fit in a=0D= >> relational database is painful, don't do it! Check out ObjectStore.=0D= >> Now part of Progress Software. http://www.objectstore.net/sourceforge=0D= >> _______________________________________________=0D >> Mysql-cocoa-users mailing list=0D >> Mys...@li...=0D >> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >>=0D >>=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) iD8DBQE+zPao5EPeG5y7WPsRAhMrAKCTGH4gR6U77r5F56LJBXCHEjRJsgCg+wn/ Vd4AnukWy/hz4sYZEEN1RWY=3D =3Dqmwm -----END PGP SIGNATURE----- |
From: John G. <jo...@jl...> - 2003-05-22 15:04:55
|
Sorry for the delay in getting back on this, I replied to a similar question a while ago, but basically if the column texte is in fact a BLOB, then what you will get back from the query is NOT an NSString, but an NSData object. If you know that the NSData object actually contains string data then you can extract a string from it using the raw data with an encoding as below NSData* contentRawBlob = [lineRes objectForKey:@"value"]; NSString* contentText = [[NSString alloc] initWithData:contentRawBlob encoding:NSASCIIStringEncoding]; Hope this helps JOhn On Tuesday, May 20, 2003, at 05:38 AM, Camille Goureau-Suignard wrote: > Hi, > > did anybody manage to retrieve a blob ? > > with string : "marotte ange" > chaine2 = [NSString stringWithFormat: @"insert commentlong > (texte) values (\"%@\") ;", [cnxCommentaireLong stringValue]] ; > > it gives in MySQL : > mysql> select * from commentlong ; > +----+--------------+ > | id | texte | > +----+--------------+ > | 1 | marotte ange | > +----+--------------+ > 1 row in set (0.05 sec) > > But when retrieving it it gives : > SMySQLResult *result2 = [connectMySQL queryString: > [NSString stringWithFormat: @"select texte from commentlong where id = > %@ ;",[ligne objectForKey: @"id_commentlong"]]] ; > [cnxCommentaireLong setStringValue: [[result2 > fetchRowAsDictionary] objectForKey: @"texte"]] ; > > <6d61726f 74746520 616e6765 > > > any idea ? > > Thanks. > > Camille > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > |
From: Camille Goureau-S. <ca...@lu...> - 2003-05-20 04:36:38
|
Hi, did anybody manage to retrieve a blob ? with string : "marotte ange" chaine2 = [NSString stringWithFormat: @"insert commentlong (texte) values (\"%@\") ;", [cnxCommentaireLong stringValue]] ; it gives in MySQL : mysql> select * from commentlong ; +----+--------------+ | id | texte | +----+--------------+ | 1 | marotte ange | +----+--------------+ 1 row in set (0.05 sec) But when retrieving it it gives : SMySQLResult *result2 = [connectMySQL queryString: [NSString stringWithFormat: @"select texte from commentlong where id = %@ ;",[ligne objectForKey: @"id_commentlong"]]] ; [cnxCommentaireLong setStringValue: [[result2 fetchRowAsDictionary] objectForKey: @"texte"]] ; <6d61726f 74746520 616e6765 > any idea ? Thanks. Camille |
From: Jason G. <jg...@wc...> - 2003-04-08 14:19:17
|
Hi everyone! I regret to inform you that I, a rank newbie, have been added t the list. I'm a longtime FM Pro programmer, who is migrating to MySQL. My immediate thought was, as I know some C, and ObjC, 'Hey, self, why not make a really attractive front end in Cocoa?' It seemed like such a simple idea, until i found out the two don't hook up! GAR! Thank god for the developers of this. I'm still working on downloading the libraries and installing them, and look forward to annoying all of you with my questions. Jason |
From: Serge C. <ser...@us...> - 2003-04-02 10:42:49
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear C=E9sar,=0D =0D The cause is that the documentation you find on the website is for the =0D= version 2 of the framework, and it looks like you downloaded the =0D version 1 (version 2 names starts with MCP, when SMySQL is in version =0D= 1).=0D =0D Solution:=0D Get version 2 (in binary or sources):=0D http://prdownloads.sourceforge.net/mysql-cocoa/ =0D SMySQL_b2.0.0.tgz?download=0D http://prdownloads.sourceforge.net/mysql-cocoa/ =0D SMySQL_s2.0.0.tgz?download=0D =0D Don't froget you have to replace SMySQLConnection by MCPConnection, and = =0D SMySQLResult by MCPResult.=0D =0D Hope I've been clear enough.=0D =0D Serge.=0D =0D PS: The ResultPlus category is only in version 2, so you really need =0D= version 2.=0D =0D =0D Le lundi, 31 mars 2003, =E0 19:00 Europe/Amsterdam, C=E9sar Escolar a = =E9crit =0D :=0D =0D > Hi I'm new using cocoa and SMySQL.framework.=0D >=0D > Im having this problem, im tryng to use this instance method =0D > "fetch2DResultAsType" and in the compilation PB shows this error:=0D >=0D > HTMLView.m:42: `MCPTypeArray' undeclared (first use in this function)=0D= > HTMLView.m:42: (Each undeclared identifier is reported only once=0D > HTMLView.m:42: for each function it appears in.)=0D > HTMLView.m:42: warning: `SMySQLResult' does not respond to =0D > `fetch2DResultAsType:'=0D >=0D > The code is:=0D >=0D > - (NSArray *)devuelvobd:(NSString *)texto=0D >=0D > {=0D > SMySQLConnection *conexion =3D [SMySQLConnection alloc];=0D > SMySQLResult *resultado;=0D > NSMutableArray *fila =3D [[NSMutableArray alloc] init];=0D >=0D > conexion =3D [conexion initToHost:@"xxx.xxx.xxx.xxx" =0D > withLogin:@"xxx" password:@"xxx" usingPort:3306];=0D > [conexion selectDB:@"xxx"];=0D > resultado =3D [conexion queryString:texto];=0D >=0D > fila =3D [resultado fetch2DResultAsType:MCPTypeArray];=0D > return fila;=0D > }=0D >=0D > in the documentation i read that is declared in "MCPResultPlus.h"=0D >=0D > I can=B4t find this header on the source.=0D >=0D > Help apreciated.=0D >=0D > Thanks and sorry for my english.=0D >=0D > C=E9sar Escolar=0D > Spain=0D >=0D >=0D >=0D > -------------------------------------------------------=0D > This SF.net email is sponsored by: ValueWeb:=0D > Dedicated Hosting for just $79/mo with 500 GB of bandwidth!=0D > No other company gives more support or power for your dedicated server=0D= > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/=0D > _______________________________________________=0D > Mysql-cocoa-users mailing list=0D > Mys...@li...=0D > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >=0D >=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) iD8DBQE+ir6w5EPeG5y7WPsRAuwWAJ4knUZcMlykwd5rnasaHR7qnXASRQCg+ZdN L8d5GK511EI+TkR4LupORyI=3D =3D3eWU -----END PGP SIGNATURE----- |
From: <ces...@ma...> - 2003-03-31 17:00:51
|
Hi I'm new using cocoa and SMySQL.framework. Im having this problem, im tryng to use this instance method=20 "fetch2DResultAsType" and in the compilation PB shows this error: HTMLView.m:42: `MCPTypeArray' undeclared (first use in this function) HTMLView.m:42: (Each undeclared identifier is reported only once HTMLView.m:42: for each function it appears in.) HTMLView.m:42: warning: `SMySQLResult' does not respond to=20 `fetch2DResultAsType:' The code is: - (NSArray *)devuelvobd:(NSString *)texto { SMySQLConnection *conexion =3D [SMySQLConnection alloc]; SMySQLResult *resultado; NSMutableArray *fila =3D [[NSMutableArray alloc] init]; conexion =3D [conexion initToHost:@"xxx.xxx.xxx.xxx" = withLogin:@"xxx"=20 password:@"xxx" usingPort:3306]; [conexion selectDB:@"xxx"]; resultado =3D [conexion queryString:texto]; fila =3D [resultado fetch2DResultAsType:MCPTypeArray]; return fila; } in the documentation i read that is declared in "MCPResultPlus.h" I can=B4t find this header on the source. Help apreciated. Thanks and sorry for my english. C=E9sar Escolar Spain |
From: Serge C. <ser...@us...> - 2003-03-19 18:53:15
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 That's definetely not a problem...=0D =0D It's just the result of some code remaining for checking if queriess =0D had results (ie. are retrieving rows).=0D =0D Typically an insert query will not retrieve row and thus will trigger =0D= this NSLog...=0D =0D Serge.=0D =0D In short: don't take care of this message.=0D =0D =0D Le mercredi, 19 mars 2003, =E0 12:43 Europe/London, Steve Woodward a =0D =E9crit :=0D =0D > I've got a working app using the smysql framework. I just tried my =0D > first "insert into" query. It works, but I get the following in NSLog:=0D= >=0D > Query worked but gives no output=0D >=0D > If I refresh the table view the newly inserted record is in fact =0D > there...is this a problem?=0D >=0D > Thanks in advance,=0D >=0D > Steve W=0D >=0D >=0D >=0D > -------------------------------------------------------=0D > This SF.net email is sponsored by: Does your code think in ink? You =0D= > could win a Tablet PC. Get a free Tablet PC hat just for playing. What = =0D > are you waiting for?=0D > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en=0D > _______________________________________________=0D > Mysql-cocoa-users mailing list=0D > Mys...@li...=0D > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >=0D >=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) iD8DBQE+eLyi5EPeG5y7WPsRAmZGAJ44BtodU1jXCbx0U2K3t7PfmqXA5wCg1bHO cSgeehrla71ohidjv4CubUA=3D =3DDBhy -----END PGP SIGNATURE----- |
From: Steve W. <ste...@ma...> - 2003-03-19 12:43:17
|
I've got a working app using the smysql framework. I just tried my first "insert into" query. It works, but I get the following in NSLog: Query worked but gives no output If I refresh the table view the newly inserted record is in fact there...is this a problem? Thanks in advance, Steve W |
From: Lorenz T. <lo...@te...> - 2003-03-16 22:39:25
|
Hi John, Thank you very much for helping me with my problem. It makes developing=20= of open-source applications possible! comments below: On Monday, March 10, 2003, at 10:55 PM, John Guy wrote: >> > Hi Lorenz, > > I've been using the Framwork for a while, and I have used BLOBs a=20 > little bit so I can offer you some overviews that may help you. > > Over the last year I have used BLOBS in two ways, first I have=20 > embedded word documents in a BLOB, and retrieved them using a cgi=20 > application I wrote in Cocoa, everything worked properly. Secondly I=20= > have used a BLOB to contain a LONGTEXT as in the older version of the=20= > Framework I am using it couldn't support large text columns. > > comments below: > > >>> For the last question I'm not sure to get it right. Let me try to=20 >>> rephrase it (and tell if I'm wrong): >>> When you retrieve a BLOB (or TEXT) from the DB it comes as a NSData=20= >>> object. You want this NSData object to be (eventualy) edited as text=20= >>> by the user. The problem you are facing is that if you transform=20 >>> this NSData to a NSString and convert it back to a NSData later the=20= >>> two NSData are different (so if your NSData correspond to a binary=20= >>> format, the data gets corrupted). >> It is exactly like this. The string I get from the NSData is for=20 >> example like this: >> GIF89a=03=01 plus a lot of strange characters >> After writing it to the db, there is only the GIF89a=03=01 without = the=20 >> rest of the string (although I escaped the string using the method=20 >> prepareString:). I think the method I use to extract the string=20 >> ([[NSString alloc] initWithData:theValue encoding:[mySQLConnection=20 >> encoding]]) is wrong. >> Maybe the problem is that the string contains characters which=20 >> "terminate" the string, for example if I insert the string in a text=20= >> file, I don't see anymore the cursor or the end of the file. The same=20= >> thing happens with the dump files my app writes; there I use the=20 >> method prepareBinaryData: with the original NSData objects. Reading=20= >> the dump afterwards works fine, but when I open the file using=20 >> TextEdit, it displays only the beginning of the file. >> > > Basically a BLOB gives you an NSData object (Binary data basically) if=20= > at any point you convert this to some form of string, unless it is=20 > escaped somehow you will lose some part of the binary data and=20 > therefore can't get back the original. In the meantime I understand that it doesn't make much sense to=20 represent binary data as a string (as long as it is not escaped for=20 using in MySQL queries). > When I was putting Binary data (word docs) INTO the database I had to=20= > use prepareBinaryData to escape the data in my NSData object so I=20 > could include it in the SQL INSERT statement. However when I retrieved=20= > the data from the database it came out as an NSData object and needed=20= > no further modification. Writing the data returned by the framework as a NSData object back to=20 the database works fine when using the method prepareBinaryData:. > When I was storing Long Text data in the BLOB, I did not need to=20 > modify my source data when inserting it into the DB (I do actually=20 > prepareStringData since it is user supplied and if they include=20 > certain characters it corrupts the SQL), however when I retrieve the=20= > data from the database I need to convert my NSData object back to an=20= > NSString object using a suitable dataEncoding. I do it exactly like this. It works fine when inserting "normal"=20 strings and I can display every type of binary data too (using the=20 NSString method initWithData:encoding:). Only certain binary data get=20 corrupted when trying to write it back to the database. But as written=20= above it works always fine when using the method prepareBinaryData: to=20= get the string out of the NSData object. > >>> >>> If this is the problem you are facing... I'll have a look to see=20 >>> what can we do about it. The main problem I'm facing with TEXT and=20= >>> BLOB column in a table is that one can not discriminate between the=20= >>> two (or at least I don't know how to do it) without issuing a=20 >>> 'DESCRIBE' command on the table (they give the same type in the=20 >>> MYSQL_RES field types). >>> Indeed after seeing the framework again I think the normal solution=20= >>> would be not to use prepareBinaryData: but prepareString: instead.=20= >>> ie once your NSData has been transformed into a string (By the way=20= >>> you can use the method stringWithText: for that), you don't want to=20= >>> use prepareBinaryData on it anymore. >> I'm using the method prepareString:, but it doesn't work. What is the=20= >> method stringWithText:? I haven't found it in the documentation. >> >> Anyway, this isn't very important because it works well with "normal"=20= >> (non binary) blob fields and some binary blob fields too; and it=20 >> doesn't make much sense to edit a binary data as a string. Dumping=20 >> the table or editing a row containing this blob fields works well >> = too. >> > > my understanding is prepareBinaryData does the SQL text encoding to=20 > represent binary data in an SQL string (it applies all sorts of escape=20= > sequences) > > prepareStringData escapes the information in the string so that it is=20= > safe to include in an SQL statement, for example it escapes characters=20= > like ' " / etc. > going back to your problem, if you are writing a program that needs to=20= > make sense of what is returned by SQL statements, you need some "local=20= > knowledge" of what to expect. If you are building an application like=20= > I am, I control what is in the DB, and therefore what i get out. If on=20= > the other hand you are building a generic appilcation, like I think=20 > you are with Cocoa-mysql, then you should use DESCRIBE to extract you=20= > local knowledge (and cache it of course) It is a generic application and I don't really know what type of data=20 is stored in the blob field (binary data such as images or only text).=20= So I will make it like you have written: Check if the field is of type=20= blob (using a DESCRIBE command), and if it is a blob using the method=20 prepareBinaryData: to get an escaped string which I can edit and write=20= back to the database. Thanks again for your help. I know now how to get this thing working in=20= the next version. Best Regards, Lorenz --=20 lorenz textor ** sh ** eigerstrasse 21 8200 schaffhausen tf 052 - 624 27 91 ** ticino ** via delle scuole 41 6963 pregassona tf 091 - 940 20 57 ** mobile 076 - 531 71 74 email lo...@te... |
From: Steve W. <ste...@ma...> - 2003-03-15 19:32:48
|
Sorry for wasting bandwidth, found my error, got a little too carried away with #import and @class statements.. :) Steve W |
From: Steve W. <ste...@ma...> - 2003-03-15 12:56:29
|
I managed to successfully create a test application using the SMySQL framework. I then started a second application in which I added the framework to the project in the exact same manner I used for the first. I added some code to make the connection then when I try and compile I get multiple errors that state there are "multiple definitions of symbol _xxxx", each error points to the variable names I declared...any thoughts? Many thanks in advance. Steve W |
From: Camille Goureau-S. <sui...@wa...> - 2003-03-12 07:35:36
|
Hi, > > I'm new to Cocoa, and really need help learning on how to get a result > from a MySQL query, and putting the result into multiple fields on an > NSTableView. Any help would be greatly appreciated, thanks. Do you know how to handle a data source for your NSTableView ? If yes, here's how I handle this : - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { id resultat ; resultat = [self obtenirChamps: [aTableColumn identifier] atIndex: [[listeIndexLocal objectAtIndex: rowIndex] intValue]] ; if (resultat != nil) return resultat ; else return @"-" ; } - (NSString*) obtenirChamps: (NSString*)champs atIndex: (int)index { SMySQLResult *result; NSDictionary *ligne; NSMutableString *chaineQuery = [[NSMutableString alloc] initWithString: @""] ; NSString *chaine ; [chaineQuery setString: @"select "] ; [chaineQuery appendString: champs] ; [chaineQuery appendString: @" from stock where id ="] ; [chaineQuery appendString: [[NSNumber numberWithInt: index] stringValue]] ; [chaineQuery appendString: @";"] ; result = [connectMySQL queryString: chaineQuery]; ligne = [result fetchRowAsDictionary] ; chaine = [ligne objectForKey: champs] ; [chaineQuery release] ; return chaine ; } Hope that helps. Camille |
From: Lorenz T. <lo...@te...> - 2003-03-11 18:37:58
|
Hi Rob P. I am working on an application called CocoaMySQL which uses the SMySQL framework, so I think I can give you some help. First of all I think the source of CocoaMySQL would give you some hints about using the framework. You can download it at cocoamysql.sourceforge.net. Especially the class CustomQuery contains code which could help you. In general, you have to do the following steps: 1. Set up a interface containing the NSTableView and set the class you are writing as the data source of the tableView. 2. Link the SMySQL framework to your project. 3. Implement methods similar to the following ones in your class (code not tested, so maybe there will be some errors while compiling): // ************************************************************************ ******************************************** in the interface: // ************************************************************************ ******************************************** #import <Cocoa/Cocoa.h> #import <SMySQL/SMySQL.h> @interface yourClass : NSObject { IBOutlet id tableView; SMySQLConnection *theConnection; NSArray *theResult; } - (void)connectToHost:(NSString *)host withLogin:(NSString *)name password:(NSString *)password usingPort:(NSString *)port; -(void)doQuery:(NSString *)queryString; // ************************************************************************ ******************************************** in the implementation: // ************************************************************************ ******************************************** - (void)connectToHost:(NSString *)host withLogin:(NSString *)name password:(NSString *)password usingPort:(NSString *)port /* makes the connection to the mysql server */ { theConnection = [[SMySQLConnection alloc] initToHost:host withLogin:login password:password usingPort:port]; } - (void)doQuery:(NSString *)queryString; /* performs the mysql-query and sets up the tableView columns */ { SMySQLResult *queryResult; int i; NSArray *theColumns; NSTableColumn *theCol; //perform query queryResult = [theConnection queryString:queryString]; if ( ![queryResult numOfRows] || !queryResult ) { //no rows in result //free tableView theColumns = [tableView tableColumns]; while ([theColumns count]) { [tableView removeTableColumn:[theColumns objectAtIndex:0]]; } theCol = [[NSTableColumn alloc] initWithIdentifier:@""]; [[theCol headerCell] setStringValue:@""]; [tableView addTableColumn:theCol]; [tableView sizeLastColumnToFit]; [tableView reloadData]; return; } //load full result in array (each row as a dictionary) theResult = [[queryResult fetch2DResultAsType:MCPTypeDictionary] retain]; //set columns //remove all columns theColumns = [tableView tableColumns]; while ([theColumns count]) { [tableView removeTableColumn:[theColumns objectAtIndex:0]]; } //add columns, corresponding to the query result theColumns = [queryResult fetchFieldsName]; for (i=0; i<[queryResult numOfFields]; i++) { theCol = [[NSTableColumn alloc] initWithIdentifier:[theColumns objectAtIndex:i]]; [theCol setEditable:NO]; [theCol setResizable:YES]; [theCol setDataCell:[[NSTextFieldCell alloc] initTextCell:@""]]; [[theCol headerCell] setStringValue:[theColumns objectAtIndex:i]]; [tableView addTableColumn:theCol]; } [tableView sizeLastColumnToFit]; [tableView reloadData]; } //tableView datasource methods - (int)numberOfRowsInTableView:(NSTableView *)aTableView /* here we return just the number of rows in the tableView */ { return [theResult count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex /* and here the value for the specified row and column */ { NSDictionary *theRow; NSString *theIdentifier = [aTableColumn identifier]; theRow = [theResult objectAtIndex:rowIndex]; if ( [[theRow objectForKey:theIdentifier] isKindOfClass:[NSData class]] ) return [[NSString alloc] initWithData:[theRow objectForKey:theIdentifier] encoding:[theConnection encoding]]; if ( [[theRow objectForKey:theIdentifier] isMemberOfClass:[NSNull class]] ) return @"NULL"; return [theRow objectForKey:theIdentifier]; } // ************************************************************************ ******************************************** Now you can call the method connectToHost:withLogin:password:usingPort: to make the connection and then the method doQuery: to perform a mysql query and load it in the tableView. I hope the code works. If you have questions, feel free to mail to me. Best Regards, Lorenz On Monday, March 10, 2003, at 09:24 PM, mys...@li... wrote: > Message: 1 > Date: Fri, 7 Mar 2003 18:09:17 -0500 > From: Rob P. <ro...@ez...> > To: mys...@li... > Subject: [Mysql-cocoa-users] MySQL Result in NSTable > > Someone please help... > > I'm new to Cocoa, and really need help learning on how to get a result > from a MySQL query, and putting the result into multiple fields on an > NSTableView. Any help would be greatly appreciated, thanks. > > Rob P. -- lorenz textor ** sh ** eigerstrasse 21 8200 schaffhausen tf 052 - 624 27 91 ** ticino ** via delle scuole 41 6963 pregassona tf 091 - 940 20 57 ** mobile 076 - 531 71 74 email lo...@te... |
From: John G. <jo...@jl...> - 2003-03-10 21:54:56
|
> Hi Lorenz, I've been using the Framwork for a while, and I have used BLOBs a=20 little bit so I can offer you some overviews that may help you. Over the last year I have used BLOBS in two ways, first I have embedded=20= word documents in a BLOB, and retrieved them using a cgi application I=20= wrote in Cocoa, everything worked properly. Secondly I have used a BLOB=20= to contain a LONGTEXT as in the older version of the Framework I am=20 using it couldn't support large text columns. comments below: >> For the last question I'm not sure to get it right. Let me try to=20 >> rephrase it (and tell if I'm wrong): >> When you retrieve a BLOB (or TEXT) from the DB it comes as a NSData=20= >> object. You want this NSData object to be (eventualy) edited as text=20= >> by the user. The problem you are facing is that if you transform this=20= >> NSData to a NSString and convert it back to a NSData later the two=20 >> NSData are different (so if your NSData correspond to a binary=20 >> format, the data gets corrupted). > It is exactly like this. The string I get from the NSData is for=20 > example like this: > GIF89a=03=01 plus a lot of strange characters > After writing it to the db, there is only the GIF89a=03=01 without the=20= > rest of the string (although I escaped the string using the method=20 > prepareString:). I think the method I use to extract the string=20 > ([[NSString alloc] initWithData:theValue encoding:[mySQLConnection=20 > encoding]]) is wrong. > Maybe the problem is that the string contains characters which=20 > "terminate" the string, for example if I insert the string in a text=20= > file, I don't see anymore the cursor or the end of the file. The same=20= > thing happens with the dump files my app writes; there I use the=20 > method prepareBinaryData: with the original NSData objects. Reading=20 > the dump afterwards works fine, but when I open the file using=20 > TextEdit, it displays only the beginning of the file. > Basically a BLOB gives you an NSData object (Binary data basically) if=20= at any point you convert this to some form of string, unless it is=20 escaped somehow you will lose some part of the binary data and=20 therefore can't get back the original. When I was putting Binary data (word docs) INTO the database I had to=20 use prepareBinaryData to escape the data in my NSData object so I could=20= include it in the SQL INSERT statement. However when I retrieved the=20 data from the database it came out as an NSData object and needed no=20 further modification. When I was storing Long Text data in the BLOB, I did not need to modify=20= my source data when inserting it into the DB (I do actually=20 prepareStringData since it is user supplied and if they include certain=20= characters it corrupts the SQL), however when I retrieve the data from=20= the database I need to convert my NSData object back to an NSString=20 object using a suitable dataEncoding. >> >> If this is the problem you are facing... I'll have a look to see what=20= >> can we do about it. The main problem I'm facing with TEXT and BLOB=20 >> column in a table is that one can not discriminate between the two=20 >> (or at least I don't know how to do it) without issuing a 'DESCRIBE'=20= >> command on the table (they give the same type in the MYSQL_RES field=20= >> types). >> Indeed after seeing the framework again I think the normal solution=20= >> would be not to use prepareBinaryData: but prepareString: instead. ie=20= >> once your NSData has been transformed into a string (By the way you=20= >> can use the method stringWithText: for that), you don't want to use=20= >> prepareBinaryData on it anymore. > I'm using the method prepareString:, but it doesn't work. What is the=20= > method stringWithText:? I haven't found it in the documentation. > > Anyway, this isn't very important because it works well with "normal"=20= > (non binary) blob fields and some binary blob fields too; and it=20 > doesn't make much sense to edit a binary data as a string. Dumping the=20= > table or editing a row containing this blob fields works well too. > my understanding is prepareBinaryData does the SQL text encoding to=20 represent binary data in an SQL string (it applies all sorts of escape=20= sequences) prepareStringData escapes the information in the string so that it is=20 safe to include in an SQL statement, for example it escapes characters=20= like ' " / etc. going back to your problem, if you are writing a program that needs to=20= make sense of what is returned by SQL statements, you need some "local=20= knowledge" of what to expect. If you are building an application like I=20= am, I control what is in the DB, and therefore what i get out. If on=20 the other hand you are building a generic appilcation, like I think you=20= are with Cocoa-mysql, then you should use DESCRIBE to extract you local=20= knowledge (and cache it of course) anyway, hope some of my experience helps out JOhn |
From: John G. <jo...@jl...> - 2003-03-10 21:39:01
|
Rob, I've been using Cocoa now for about a year now, and I've been using Serge's Framework since it came out. a couple of points to help get you going: 1) As has already been mentioned, if you want to get to grips with Cocoa as painlessly as possible, get hold of Aaron Hillegass's excellent book "Cocoa programming for Mac OS X" it will save you a lot of heart ache, and has excellent examples. 2) You can also subscribe to the cocoa-dev list over at Apple's developer site, but it is a high volume mailing list. BUT the mailing list is archived at http://cocoa.mamasam.com/ and here you can find answers to nearly everything you need. OK to get cocoa working with the mysql framework and your table views you need to actually achieve two different things: 1) Get connected to the database, issue a query, and get the results back. This is actually really straight forward, and the best place to start is to have a look at the documentation that comes with the Framework and the test application. Basically you need to establish a data base connection (using one of the framework classes) and then you send your query to the new object and it will return you a result set you can enumerate through. 2) Next you will need to cache the data you retrieved within your cocoa application so you can feed the NSTableView when it asks for things (you will need to write the delegate methods for the NSTableView). NOTE I am recommending you cache the query results otherwise you will incur a huge overhead hitting the DB everytime the user does something that causes OSX to redraw the table view. If you think in terms of Model View Controller, you manage you Model as a combination of the local cache and the database, the view contains your NSTableView, and the controller manages the delegate methods etc. that feed the table view from the Model. I hope this gives you some pointers to get you going. I am still using a fairly old version of the Framework (as I haven't had time to update my application to use the new object names and method calls that Serge introduced a while ago), however at some point in the near future I am sure I could whip up a simple test program for you ALTHOUGH I think you would find it better to just get it going yourself from the examples ;) all the best JOhn On Friday, March 7, 2003, at 11:09 PM, Rob P. wrote: > Someone please help... > > I'm new to Cocoa, and really need help learning on how to get a result > from a MySQL query, and putting the result into multiple fields on an > NSTableView. Any help would be greatly appreciated, thanks. > > Rob P. > > |
From: Lorenz T. <lo...@te...> - 2003-03-08 15:52:01
|
P.S. I have searched a bit in this mail list and I think that I will=20 make it like this (regarding the problem of editing fields containing=20 binary data): - test if field is blob or text (using a DESCRIBE syntax if I don't=20 find another way) - use the method stringWithText: if it is a text field - if it is a blob field: maybe I will use the method prepareBinaryData:=20= (the only problem is that then the string is escaped which isn't so for=20= all other field types in my app) Thanks again for your help, Lorenz On Wednesday, February 26, 2003, at 12:14 AM, Serge Cohen wrote: > Dear Lorenz > > Sorry not to have answered earlier. I'll try to give you as much info=20= > as I can: > > For the SSL issue: > I'm afraid I can not answer the question for sure. What I can tell you=20= > is that on Jaguar (10.2.3 indeed) I managed to compile MySQL with SSL=20= > support (including the libmysqlclient library onn which I rely to make=20= > connection to MySQL servers). This means that even if it is not=20 > already possible to use the framework as is for connecting to MySQL=20 > using SSL, it should not be too difficult to get to this point. > For the answer of how to manage to do it, I can suggest to ways: > 1. Look the documentation of MySQL (client library) and check what is=20= > required to have a SSL connection. Maybe you need to set a particular=20= > flag from the MYSQL pointer. Than you can do it by default (changing=20= > default in the source of the framework). > 2. You can also add a method to MCPConnection to be able to set this=20= > option at runtime. > 3. If you can still wait a month (or maybe a bit more), you can wait=20= > for me to have the time to make it. I need this time because I have a=20= > lot of work now and I also need to set a SSL aware MySQL server to=20 > test the new sources... which will take a bit of time for me because=20= > I've never done anything similar alreasdy (basically the time to read=20= > doc, reset properly the setting of my testing server, and then ONLY I=20= > can modify the MCPConnection...). > > By the way, if you chose sol. 2. I'm (obviously) interested by the=20 > modification you make to MCPConnection for further inclusion in the=20 > framework (more likely as the basis of new addition to the framework). > > > > For the table type: > I don't have precise answer here neither... BUT I have InnoDB running=20= > on my mac, and event if so far I've never used through the framework,=20= > it should not be to hard for me to test it. SO I'll try to give you a=20= > documented answer in the coming two weeks (still I don't foresee any=20= > reasons for that 'incompatibility', ie. my guess would be that the=20 > problem does not come from the framework). > > > > For the last question I'm not sure to get it right. Let me try to=20 > rephrase it (and tell if I'm wrong): > When you retrieve a BLOB (or TEXT) from the DB it comes as a NSData=20 > object. You want this NSData object to be (eventualy) edited as text=20= > by the user. The problem you are facing is that if you transform this=20= > NSData to a NSString and convert it back to a NSData later the two=20 > NSData are different (so if your NSData correspond to a binary format,=20= > the data gets corrupted). > > If this is the problem you are facing... I'll have a look to see what=20= > can we do about it. The main problem I'm facing with TEXT and BLOB=20 > column in a table is that one can not discriminate between the two (or=20= > at least I don't know how to do it) without issuing a 'DESCRIBE'=20 > command on the table (they give the same type in the MYSQL_RES field=20= > types). > Indeed after seeing the framework again I think the normal solution=20 > would be not to use prepareBinaryData: but prepareString: instead. ie=20= > once your NSData has been transformed into a string (By the way you=20 > can use the method stringWithText: for that), you don't want to use=20 > prepareBinaryData on it anymore. > > Sorry for not answering your question (still I hope you get some=20 > clues), thank you very much for your feed back, and I'd hope we will=20= > continue this thread whenever we have time (meaning: sorry in advance=20= > if I take some time to answer to your next mail). > > Serge. > > PS: As you see, I posted this also to the user mailing list. Please=20 > I'd like that all these mails go there instead of directly to me. I AM=20= > READING the list, and I'm not the only one (from the number of people=20= > inscribed there). I'm sure some of the few persons there might have=20 > already experienced some of your problems and can help you (and me at=20= > the same time). > > PPS: I'd be interested to know which version of the framework you are=20= > using, and on what version of your own software you already are. > > PPPS: last remark: If the problem is the very (very) low traffic on=20 > the mailing list, just consider that the traffic has to start on some=20= > time... > > > PPPPS: Sorry one more: remind me of linking to your project from the=20= > framework page if it is not already done. > > > Le mercredi, 19 f=E9v 2003, =E0 10:13 Europe/Amsterdam, Lorenz Textor = a=20 > =E9crit : > >> Hi Serge, >> >> As I wrote to you some months ago I'm developing an application=20 >> called CocoaMySQL using your framework to connect to the MySQL server=20= >> (see cocoamysql.sourceforge.net). Thanks again for coding this great=20= >> framework and for making it open-source! >> >> I have some questions regarding the framework: >> - Many persons asked me if it is possible to connect securely to the=20= >> MySQL server using SSL. I looked a bit at the MySQL C API and think=20= >> there is an option to do it. Would it be difficult to change the=20 >> framework so that secure connections are possible? Or is it possible=20= >> with the current version yet? >> - Some people wrote me they have problems using other table types=20 >> (InnoDB for example). Can this be a problem of the framework? >> - How can I represent a BLOB field (NSData object) as a string that=20= >> can be edited and saved to the database afterwards? I don't want the=20= >> string to be escaped, so I can use prepareBinaryData: only after=20 >> editing. Now I'm using something like >> [[NSString alloc] initWithData:theData encoding:[mySQLConnection=20= >> encoding]]; >> In most cases this works, but with binary data (for example images)=20= >> the data gets corrupted. >> >> Thank you for your help! >> Best Regards, >> Lorenz >> >> >> > ---------------------------------------------------- > Serge Cohen > > GPG Key ID: Non-Available for the moment. > ---------------------------------------------------- > > --=20 lorenz textor ** sh ** eigerstrasse 21 8200 schaffhausen tf 052 - 624 27 91 ** ticino ** via delle scuole 41 6963 pregassona tf 091 - 940 20 57 ** mobile 076 - 531 71 74 email lo...@te... |
From: Lorenz T. <lo...@te...> - 2003-03-08 15:24:45
|
Dear Serge, Thank you very much for taking the time to respond so detailed. > Sorry not to have answered earlier. I'll try to give you as much info=20= > as I can: As you see I had much longer to answer (I was in holidays and hadn't=20 the possibility to check my emails ;-) > For the SSL issue: > I'm afraid I can not answer the question for sure. What I can tell you=20= > is that on Jaguar (10.2.3 indeed) I managed to compile MySQL with SSL=20= > support (including the libmysqlclient library onn which I rely to make=20= > connection to MySQL servers). This means that even if it is not=20 > already possible to use the framework as is for connecting to MySQL=20 > using SSL, it should not be too difficult to get to this point. > For the answer of how to manage to do it, I can suggest to ways: > 1. Look the documentation of MySQL (client library) and check what is=20= > required to have a SSL connection. Maybe you need to set a particular=20= > flag from the MYSQL pointer. Than you can do it by default (changing=20= > default in the source of the framework). I found in the documentation that I can set the flag CLIENT_SSL in the=20= mysql_real_connect() function. By now I have no possibility to test it=20= because I have not set up my system to work with SSL. If I will find=20 the time, I'll try to set up a test server and test it with your=20 framework. > 2. You can also add a method to MCPConnection to be able to set this=20= > option at runtime. I would make it like this, because the standard way to connect would=20 remain without SSL. > 3. If you can still wait a month (or maybe a bit more), you can wait=20= > for me to have the time to make it. I need this time because I have a=20= > lot of work now and I also need to set a SSL aware MySQL server to=20 > test the new sources... which will take a bit of time for me because=20= > I've never done anything similar alreasdy (basically the time to read=20= > doc, reset properly the setting of my testing server, and then ONLY I=20= > can modify the MCPConnection...). > > By the way, if you chose sol. 2. I'm (obviously) interested by the=20 > modification you make to MCPConnection for further inclusion in the=20 > framework (more likely as the basis of new addition to the framework). I would be glad to help you with this modifications, but unfortunately=20= I also haven't a lot of time to work on these things (and it would take=20= me a lot of time to set up SSL because I never worked with it, and I am=20= rather a Unix newbie too...). > > For the table type: > I don't have precise answer here neither... BUT I have InnoDB running=20= > on my mac, and event if so far I've never used through the framework,=20= > it should not be to hard for me to test it. SO I'll try to give you a=20= > documented answer in the coming two weeks (still I don't foresee any=20= > reasons for that 'incompatibility', ie. my guess would be that the=20 > problem does not come from the framework). I'm nearly sure that this is a problem of the MySQL server=20 configuration. But I never worked with this tables and therefore I=20 can't be sure of this. If you could try it (maybe with my app), it=20 would be great, but it isn't that important or urgent. > For the last question I'm not sure to get it right. Let me try to=20 > rephrase it (and tell if I'm wrong): > When you retrieve a BLOB (or TEXT) from the DB it comes as a NSData=20 > object. You want this NSData object to be (eventualy) edited as text=20= > by the user. The problem you are facing is that if you transform this=20= > NSData to a NSString and convert it back to a NSData later the two=20 > NSData are different (so if your NSData correspond to a binary format,=20= > the data gets corrupted). It is exactly like this. The string I get from the NSData is for=20 example like this: GIF89a=03=01 plus a lot of strange characters After writing it to the db, there is only the GIF89a=03=01 without the = rest=20 of the string (although I escaped the string using the method=20 prepareString:). I think the method I use to extract the string=20 ([[NSString alloc] initWithData:theValue encoding:[mySQLConnection=20 encoding]]) is wrong. Maybe the problem is that the string contains characters which=20 "terminate" the string, for example if I insert the string in a text=20 file, I don't see anymore the cursor or the end of the file. The same=20 thing happens with the dump files my app writes; there I use the method=20= prepareBinaryData: with the original NSData objects. Reading the dump=20 afterwards works fine, but when I open the file using TextEdit, it=20 displays only the beginning of the file. > > If this is the problem you are facing... I'll have a look to see what=20= > can we do about it. The main problem I'm facing with TEXT and BLOB=20 > column in a table is that one can not discriminate between the two (or=20= > at least I don't know how to do it) without issuing a 'DESCRIBE'=20 > command on the table (they give the same type in the MYSQL_RES field=20= > types). > Indeed after seeing the framework again I think the normal solution=20 > would be not to use prepareBinaryData: but prepareString: instead. ie=20= > once your NSData has been transformed into a string (By the way you=20 > can use the method stringWithText: for that), you don't want to use=20 > prepareBinaryData on it anymore. I'm using the method prepareString:, but it doesn't work. What is the=20 method stringWithText:? I haven't found it in the documentation. Anyway, this isn't very important because it works well with "normal"=20 (non binary) blob fields and some binary blob fields too; and it=20 doesn't make much sense to edit a binary data as a string. Dumping the=20= table or editing a row containing this blob fields works well too. > > Sorry for not answering your question (still I hope you get some=20 > clues), thank you very much for your feed back, and I'd hope we will=20= > continue this thread whenever we have time (meaning: sorry in advance=20= > if I take some time to answer to your next mail). Thank you for helping me and for developing the framework! I would be=20 glad to continue this thread too, but I will also need a bit of time to=20= answer ;-) > Serge. > > PS: As you see, I posted this also to the user mailing list. Please=20 > I'd like that all these mails go there instead of directly to me. I AM=20= > READING the list, and I'm not the only one (from the number of people=20= > inscribed there). I'm sure some of the few persons there might have=20 > already experienced some of your problems and can help you (and me at=20= > the same time). I will make it like this starting with this email! > PPS: I'd be interested to know which version of the framework you are=20= > using, and on what version of your own software you already are. The version I use is still the beta of the version 1.0. I would like to=20= update to v2.0, but I haven't found the time to make the necessary=20 changes to my code (especially I would have to test the app very=20 carefully to be sure that all things work like they worked before).=20 Anyway, all the methods I use in my app work perfectly! The current version of my CocoaMySQL is v0.4 (which I will release=20 after some final testing this evening or tomorrow). You find it on=20 cocoamysql.sourceforge.net if you are interested... > PPPS: last remark: If the problem is the very (very) low traffic on=20 > the mailing list, just consider that the traffic has to start on some=20= > time... That's right. I have subscribed to it today and will try to contribute=20= to the list as much as I can! > > PPPPS: Sorry one more: remind me of linking to your project from the=20= > framework page if it is not already done. This would be great! I have placed a link to the framework page=20 (http://mysql-cocoa.sourceforge.net/) on my site (hope this is the=20 right page). Best Regards, Lorenz > > Le mercredi, 19 f=E9v 2003, =E0 10:13 Europe/Amsterdam, Lorenz Textor = a=20 > =E9crit : > >> Hi Serge, >> >> As I wrote to you some months ago I'm developing an application=20 >> called CocoaMySQL using your framework to connect to the MySQL server=20= >> (see cocoamysql.sourceforge.net). Thanks again for coding this great=20= >> framework and for making it open-source! >> >> I have some questions regarding the framework: >> - Many persons asked me if it is possible to connect securely to the=20= >> MySQL server using SSL. I looked a bit at the MySQL C API and think=20= >> there is an option to do it. Would it be difficult to change the=20 >> framework so that secure connections are possible? Or is it possible=20= >> with the current version yet? >> - Some people wrote me they have problems using other table types=20 >> (InnoDB for example). Can this be a problem of the framework? >> - How can I represent a BLOB field (NSData object) as a string that=20= >> can be edited and saved to the database afterwards? I don't want the=20= >> string to be escaped, so I can use prepareBinaryData: only after=20 >> editing. Now I'm using something like >> [[NSString alloc] initWithData:theData encoding:[mySQLConnection=20= >> encoding]]; >> In most cases this works, but with binary data (for example images)=20= >> the data gets corrupted. >> >> Thank you for your help! >> Best Regards, >> Lorenz >> >> >> > ---------------------------------------------------- > Serge Cohen > > GPG Key ID: Non-Available for the moment. > ---------------------------------------------------- > > --=20 lorenz textor ** sh ** eigerstrasse 21 8200 schaffhausen tf 052 - 624 27 91 ** ticino ** via delle scuole 41 6963 pregassona tf 091 - 940 20 57 ** mobile 076 - 531 71 74 email lo...@te... |
From: Rob P. <ro...@ez...> - 2003-03-07 23:34:13
|
Someone please help... I'm new to Cocoa, and really need help learning on how to get a result from a MySQL query, and putting the result into multiple fields on an NSTableView. Any help would be greatly appreciated, thanks. Rob P. |
From: Colin C. <c.c...@sy...> - 2003-02-26 21:27:58
|
Hi ! Do you have the Aaron Hillegass Cocoa programming for Mac OS X? If not get it, tones of questions will be answered. As for adding frameworks just ctrl-click in the "file" tabbed window click on frameworks. then add #import <TheFile/TheFile.h> in the XXXXXXX_Prefix.h file in the "other sources" folder. As to getting started, even if I have not yet tried MySql frameworks I learnt a great deal with the http://www.openbase.com dev package. There is a pdf manual, code examples and stuff to get you started. Then switch your code for Mysql framework. Hope this helps. Colin On Wednesday, February 26, 2003, at 03:17 PM, mys...@li... wrote: > > Message: 5 > Date: Wed, 26 Feb 2003 18:06:33 +0000 > From: Ian C Roberts <ian...@ma...> > To: mys...@li... > Subject: [Mysql-cocoa-users] Using the framework within a GUI > Application > > All, > Could someone please point me in the right direction by telling me how > to use the framework within PB. I am desperate to start developing my > application. I have tried to do add framework but I cant seem to get > anywhere.... > > Thanks very much, > Ian > > > > > --__--__-- > > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > > > End of Mysql-cocoa-users Digest > |
From: Ian C R. <ian...@ma...> - 2003-02-26 18:05:27
|
All, Could someone please point me in the right direction by telling me how to use the framework within PB. I am desperate to start developing my application. I have tried to do add framework but I cant seem to get anywhere.... Thanks very much, Ian |