• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WebObjects and mySQL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebObjects and mySQL


  • Subject: Re: WebObjects and mySQL
  • From: Kieran Kelleher <email@hidden>
  • Date: Fri, 30 Jan 2004 00:57:36 -0500

True, while USER is not listed as a reserved word at:
http://www.mysql.com/doc/en/Reserved_words.html
... it certainly exists as a FUNCTION in MySQL and functions should not be used for table or column names either unless you like playing with fire! See USER listed in the Other Functions page:
http://www.mysql.com/doc/en/Information_functions.html


Amazingly, MySQL uses a table called "user" in its privileges database and it has a column named 'User' !! But, I guess they hacked their own SQL statements to allow for that! Remember WO is generating SQL probably taking into account the primary list of reserved words (or maybe not taking any reserved words into account, so best to avoid them.

Hint for you ... use all lower case for table names and column names. I cannot remember why, but I know I read something that gave a good reason for sticking with lower case table/column names as a best practice in MySQL :-)

Kieran
____________________________________
OS X 10.3.2 /  WO 5.2.2 / MySQL 4.0.16


On Jan 30, 2004, at 12:18 AM, Claes-Fredrik Mannby wrote:

It's best to rename your user table to something else. You don't need to rename the object, just the table name. User is indeed a reserved word, although MySQL behaves as if just another space is needed. I found this one out after extensive googling.

Also note that you shouldn't even bother with EOModeler's Synchronize Schema command. At least with MySQL it doesn't work at all if you use join tables, because of some constraint syntax mismatch, is my guess. Fortunately, you don't need it. You can use the Generate SQL command. It works mostly fine.

Fred

On Jan 29, 2004, at 8:22 PM, Chuck Hill wrote:

I'll hazard a guess that USER is a reserverd word and needs to be
double-quoted:
INSERT INTO "USER"(name, userID) VALUES ('fasdfasdfsdf', 2);

That job is usually handled by the plug-in as it is aware of any DB
specific reserved words. However, the mySQL plugin is part of the JDBC
adaptor so that does not make much sense. You could try a different table
name...



Chuck



At 03:02 PM 30/01/2004 +1100, Owen McKerrow wrote:
Hi guys,

Thanks for the help. I have down what you have suggested and now
EOModler can see the DB. I've started with a test one, with one table
USER and 2 attributes name and userID. I did a quick WODisplayGroup
Application and try to insert and save a new user. But I receive the
following error...


INSERT INTO USER(name, userID) VALUES (?, ?)" withBindings:
1:"fasdfasdfsdf"(name), 2:2(userID)>:
Next exception:SQL State:42000 -- error code: 1064 -- msg: Syntax
error or access violation, message from server: "You have an error in
your SQL syntax near 'USER(name, userID) VALUES ('fasdfasdfsdf', 2)' at
line 1"


It all seems very simple and straight fwd so Im not sure what could be
causing the error. Any ideas on things I should check for ?


Owen

On Thursday, January 29, 2004, at 02:30 PM, David Holt wrote:

In addition to what Jonathon wrote:

in the database url put jdbc:mysql://localhost/your_database_name
put in user/password combo if you have one for the database

filling in the driver box  is not necessary for WO 5.2 (EOModeler)

david

--
The only way to make a man worthy of love is by loving him.

Thomas Merton

from Sunbeams: http://www.thesunmagazine.org
On 28-Jan-04, at 7:22 PM, Jonathan 'Wolf' Rentzsch wrote:

Owen McKerrow, email@hidden, wrote:
People keep referring to Anjo Krank's page (
http://www.kcmedia.de/RegEx/mysql-wo.html ) for setting up mySQl and
WebObjects but that page is down. Does any one have copy of the info
on
it that they could send me ?

All I had to do to get MySQL to work with WO is plop mysql-connector-java-3.0.9-stable-bin.jar into /Library/Java/Extensions. After that is Just Worked. WO 5.2.2, by the way.

.......................................................
Jonathan 'Wolf' Rentzsch            http://rentzsch.com
Red Shed Software   http://redshed.net   (847) 584-7465
PGP: b2af 1a09 f881 ebde c9d6  c4d2 c04f a3c0 3ec5 d5f2

         "better" necessarily means "different"
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


 'The test of a first-rate intelligence is the ability to hold two
opposed ideas in the mind at the same time and still be able to
function.'
-F.Scott Fitzgerald,
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


--

Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: WebObjects and mySQL (From: David Holt <email@hidden>)
 >Re: WebObjects and mySQL (From: Chuck Hill <email@hidden>)
 >Re: WebObjects and mySQL (From: Claes-Fredrik Mannby <email@hidden>)

  • Prev by Date: Re: WebObjects and mySQL
  • Next by Date: ISO Time & Scalar values
  • Previous by thread: Re: WebObjects and mySQL
  • Next by thread: Re: WebObjects and mySQL
  • Index(es):
    • Date
    • Thread