• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes

Problem :

I am updating values using JDBC but getting bellow error
java.sql.sqlexception: column count doesn't match value count at row 1
by (6.9k points)  

1 Answer

0 votes

Solution :

Probably you are making a mistake with your quotes.

The proper Syntax as bellow:

INSERT INTO tablename(field1,field2) VALUES ('Text1,Text2'); 

So you need to write:

String Query_String = "INSERT INTO tablename(field1,field2) 
VALUES ('"+Text1+"','"+Text2+"')"

Further Readings:

by (33.3k points)