Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC SQL QUERY PROBLEM

 
Tania Sen
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a student database
My database has columns as:
roll name stream year jan feb march april .... dec

now i take user input in a jsp page and pass to servlet ..I take month ,attendance, and roll as input..
my sql query in the servlet is


its not working ..it only works if i give the months name

..but the month is supplied by the user !!
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guitar maniac wrote:

Please check your private messages for an important administrative matter.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49789
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please avoid writing all in CAPITAL letters.
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
update attendance set ? =? where roll=?

Hi, you can't bind a column name. The first question mark is invalid.

Regards, Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic