Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
Bartender
Posts: 11445
18
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
Marshal
Posts: 53096
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please avoid writing all in CAPITAL letters.
 
Jan Cumps
Bartender
Posts: 2618
14
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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!