我有这段代码:
String updText = "update table set varcharPar=?, floatPar=?, datePar=?, intPar=? where id=7"
def updateCounts = sql.withBatch(1, updText) { ps ->
def args = [Types.NULL, Types.NULL, Types.NULL, Types.NULL]
ps.addBatch(args)
}
当我尝试更新时,它不能使用varchar参数,给我
Caught: java.sql.BatchUpdateException: Implicit conversion from datatype 'INT' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.
适用于int,float和date。我怎么解决这个问题?
如果我把null而不是Types.NULL,它不适用于float。