• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

properties file with SQL statements

 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm running an application that is connected to a MySQL database. I have a Servlet with a method that connects to the database and attempts to update a table named INSTRUCTORS. I keep a properties file full of SQL statements, one of which is:

updateInstructorQuery=UPDATE INSTRUCTORS SET ADMINISTRATOR_ID=?, RETIRED_ADMIN_ID=NULL, EMPLOYEE_ID=?, FIRSTNAME=?, LASTNAME=?, DEPARTMENT=?, WORK_PHONE=?, ADDRESS=?, CITY=?, STATE_PROVINCE=?, COUNTRY=?, ZIP_PCODE=?, HOME_PH0NE=?, CELL=? WHERE COMPANY_ID=? AND EMPLOYEE_ID=?;

When I run the method I keep getting an SQLException:

SQL Problem: Column not found message from server: "Unknown column 'HOME_PH0NE' in 'field list'"
SQL State: S0022
Vendor Error: 1054
20 [http-8080-Processor24] ERROR mvcs.InstructorModel - SQL Exception
java.sql.SQLException: Column not found message from server: "Unknown column 'HOME_PH0NE' in 'field list'"

I don't understand why I'm getting this exception when the HOME_PHONE field is definitely a field in the table INSTRUCTORS! I'm thinking there must be something wrong with my SQL statement, but I don't see it!

Please Advise,

Alan
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fortunately you used copy-and-paste to post this question, because I can see that you have a digit-zero instead of a letter-O in the middle of PH0NE.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'll be...

That's it! I knew it had to be something really stupid. But yesterday I just couldn't see it. That was supposed to be an O not a zero 0.

Thanks Again,

Alan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic