BadSqlGrammerException

问题描述 投票:0回答:0

我的查询字符串是:

UPDATE_Z-TABLE = " UPDATE STATUS SET FLAG = ?0, TIMESTAMP = ?1 where APP = (" + id + ") "; 

异常详情:

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammer [UPDATE STATUS SET FLAG = ?0, TIMESTAMP = ?1 where APP = (1000) ]; nested exception is java.sql.SQLSyntaxErrorException: you have an error in your sql syntax; check the manual that corresponds to your MYSQL Server version for the right syntax to use near '1 where APP =(1000)' at line 1

我正在努力做

UPDATE_Z-TABLE = " UPDATE STATUS SET FLAG = ?0, TIMESTAMP = ?1 where APP in (?2)"; 

但它被视为字符串

'1 where APP in (1000'2)';

我正在尝试在 MS SQL 中执行。

java sql sql-server spring jdbc
© www.soinside.com 2019 - 2024. All rights reserved.