It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes JDBC SQL QUERY PROBLEM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC SQL QUERY PROBLEM" Watch "JDBC SQL QUERY PROBLEM" New topic
Author

JDBC SQL QUERY PROBLEM

Tania Sen
Greenhorn

Joined: Feb 28, 2010
Posts: 8
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

Joined: Jul 26, 2007
Posts: 10745
    
    9

guitar maniac wrote:

Please check your private messages for an important administrative matter.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44006
    
  33
And please avoid writing all in CAPITAL letters.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2543
    
  10

update attendance set ? =? where roll=?

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

Regards, Jan


OCUP UML fundamental and ITIL foundation
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: JDBC SQL QUERY PROBLEM
 
It's not a secret anymore!