SQL Query works in workbench but gives syntax error in java
问题 I ran the query in both sql Workbench and in the executeUpdate() method in java: in Workbench: INSERT INTO recentsearches (name) VALUES ("blah"); in java: statement.executeUpdate("INSERT INTO recentsearches (name) VALUES (\""+name+"\"")); Assuming name = "blah". But I get a syntax error from running the query in java, I've already checked the string value for name. It definitely comes up as "blah", and I didn't forget the speech marks around string values, yet I still get a syntax error. The