• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

properties file with SQL statements

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic