提交 0cb8f16b 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

oracle数据库时间类型字段问题修复

上级 842f7825
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
...@@ -44,7 +45,7 @@ public class DataObject { ...@@ -44,7 +45,7 @@ public class DataObject {
} }
Object resultValue=fieldValue; Object resultValue=fieldValue;
String targetType=type.getSimpleName(); String targetType=type.getSimpleName();
if(targetType.equalsIgnoreCase(fieldValue.getClass().getSimpleName())){ if(targetType.equals(fieldValue.getClass().getSimpleName())){
return resultValue; return resultValue;
} }
if(targetType.equals("Boolean")){ if(targetType.equals("Boolean")){
...@@ -379,6 +380,16 @@ public class DataObject { ...@@ -379,6 +380,16 @@ public class DataObject {
return new java.sql.Timestamp(lValue); return new java.sql.Timestamp(lValue);
} }
if(objValue instanceof oracle.sql.TIMESTAMP)
{
try {
oracle.sql.TIMESTAMP tValue = (oracle.sql.TIMESTAMP)objValue;
return tValue.timestampValue();
} catch (SQLException e) {
return tDefault;
}
}
return tDefault; return tDefault;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册