oracle jdbc update bind 不成功

正常的oralce update语句:

update apmtest set apm_int=20 where apm_nchar='11' and apm_numeric='12';

不知道为什么jdbc update bind两个参数时,就是执行不成功?怀疑是单引号的问题

执行不成功:

PreparedStatement ps_update1 = con
.prepareStatement("update apmtest set apm_int=? where apm_nchar=? and apm_numeric=?");
ps_update1.setInt(1, 20);
ps_update1.setString(2, "11");
ps_update1.setString(3, "12");

ps_update1.execute();

执行成功:

PreparedStatement ps_update1 = con
.prepareStatement("update apmtest set apm_int=? where apm_nchar='11' and apm_numeric=?");
ps_update1.setInt(1, 20);
ps_update1.setString(2, "12");
ps_update1.execute();

检查一下你的apm_nchar和apm_numeric字段的数据类型是文本类的还是数字类的,如果是数字类的,不需要加引号。
另外有些语言string和char使用不同的引号,比如string使用双引号,char使用单引号,如果你有字段是char的,把相应的地方改成单引号试一试