在使用postgre时,如果直接执行:
INSERT INTO timetest (run_time) VALUES ('12:09:21'),是没有问题的。
但是如果在java中使用:
INSERT INTO timetest (run_time) VALUES (?),getPara("time")时,提示:
org.postgresql.util.PSQLException: 错误: 字段 "run_time" 的类型为 time without time zone, 但表达式的类型为 character varying。
jfinal只有getParaToData(),可以单独封装一个类,继承Controller:
@NotAction
public Time getParaToTime(String name) {
String value = getPara(name);
if(StrKit.notBlank(value)) {
return Time.valueOf(value);
}
else {
return null;
}
}
项目:JFinal