This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC SQL QUERY PROBLEM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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: 10167
    
    8

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: 37950
    
  22
And please avoid writing all in CAPITAL letters.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

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
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC SQL QUERY PROBLEM
 
Similar Threads
How to update a database using web forms
Database update
SQL Error
handling quotes in sql queries
set values in a table from other