File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC SQL QUERY PROBLEM

 
Tania Sen
Greenhorn
Posts: 8
  • 0
  • 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: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • 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: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please avoid writing all in CAPITAL letters.
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic