在 JDBC 中工作时,我不断收到令牌的语法令牌错误hoursWorkedToday
,即使它是一个合法变量,并且hoursWorked
是一个列名。类型也匹配。
projectUpdate.executeUpdate("INSERT INTO projectLog (hoursWorked, weyerhaeuserWork, sudokuWork,websiteWork, scriptWork," +
"tropeWork) VALUES ("hoursWorkedToday +",'"+internWork+"','"+sudokuWork+"', '"+websiteWork+"' ,'"+scriptWork+"' ,'"+tropeWork+"')");
再次出现错误hoursWorkedToday
,不知道为什么......语法与我运行的其他查询匹配,例如......
workoutUpdate.executeUpdate("INSERT INTO workoutLog (workedOut, milesRan, comments) VALUES (1,"+miles+" ,"+
workoutComments+"')");