Originally posted by Swapna Gouri Kalanidhi:
Hi All
I'm trying to insert data into database using Servlets and JSP. Using MySQL database. But I'm getting SQLException : Column count doesn't match value count at row 1. I have verified all the columns and their data types in the database against the one in my Servlet program. Unable to trace the root cause of this error. Here's the program and the stack trace:
Table description:
Can any one tell me why we get this error and where my program went wrong?
[ December 22, 2008: Message edited by: Swapna Gouri Kalanidhi ]
[ December 22, 2008: Message edited by: Swapna Gouri Kalanidhi ]
Usually when I see this error it is because there is an auto-incrementing column that isn't included in your insert (when you don't specify the column names, the database engine assumes you're providing all of them)... is there a key column you left off your description... if there is and you use the insert without the column names... you have to pass a zero byte column value in the insert... i.e. ''... If you use the column names... you are not impacted by this... and you are also not impacted by table changes to add columns to the table you may not need with your application.