The method setDate(int, java.sql.Date) in the type PreparedStatement is not applicable for the argum
程序员文章站
2022-07-15 13:22:32
...
The method setDate(int, java.sql.Date) in the type PreparedStatement is not applicable for the arguments (int, java.util.Date)
原因: java.sql.Date和 java.util.Date不能兼容
解决方法:
java.util.Date date = sdf.parse(date_s);
pst.setDate(1, date);
转换:
pst.setDate(1, new Date(date.getTime()));
上一篇: 在插件模式开发中获取portal相关信息
下一篇: Portlet之间传值