我知道,因为PreparedStatement
我需要将 SQL 表达式输入PreparedStatement
像这样
String updateStatement =
"update " + dbName + ".COFFEES " +
"set TOTAL = TOTAL + ? " +
"where COF_NAME = ?";
但是,我可以在没有“?”的情况下使用完整的 where 子句来提供更新语句?
例如
String updateStatement =
"update " + dbName + ".COFFEES " +
"set TOTAL = TOTAL + ? " +
"where COF_NAME = 'aaa";
这只是因为我where
在我的函数中获得了作为参数,并且我认为解析字符串以将其分解并不有效。