The SQLException getMessage() method returns the following:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name, Last Name, School ID Number) VALUES('Joel', 'Christophel', '101059')' at line 1
I think that might require putting quotes around them, but I don't see anything about that in the MySQL documentation except for something which says that you escape reserved words by putting a back-tick before them.
EDIT: After further research, I found the using back ticks (as you mentioned) works for column names with spaces. http://stackoverflow.com/questions/6055505/blank-spaces-in-column-names-with-mysql
- X 2
Paul Clapham wrote:Thanks for the feedback Joel!
(In my opinion, using standard column names -- no spaces -- is preferable to having to escape them with back-ticks every time you use them in a query.)
I seriously dislike have spaces in column names, but they all seem to allow it these days.
Paul Clapham wrote:(In my opinion, using standard column names -- no spaces -- is preferable to having to escape them with back-ticks every time you use them in a query.)
+1 for that. Putting spaces in your table/column names, or making them case-sensitive, just gives you another potential source of errors further down the line.