I am trying to get a JSP/Servlet to POST data to a database via a Bean. everything seems to be working fine apart from when the bean tries to INSERT into the database i get this error: "Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 6" I think its just a problem with the SQL command: String insertSQL = "INSERT INTO userInfo (fname,sname,dob1,dob2,dob3,email,telno,address1,address2,address3) VALUES ("+fname+","+sname+","+dob1+","+dob2+","+dob3+","+email+","+telno+","+address1+","+address2+","+address3+")"; But I'm not sure. I think I'm really close to getting this, it's just this last little problem! Many tahnks KPSUK
Hi Kps, <aside> Dirk, if this person's name is "Kps", then I'm the Pope! </aside> In case you are unaware, string literals in SQL need to be delimited by single quotes -- which I did not see in the code you posted. I think a better alternative would be to use a "PreparedStatement" instead of a "Statement", however. Good Luck, Avi. [ July 16, 2003: Message edited by: Avi Abrami ]
Joined: Jun 05, 2003
Ooh I have changed Statement to PreparedStatement now I'm getting a new error: java.sql.SQLException: Driver does not support this function I guess it's to do with the JDBC driver(s) on Windows.