oracle.sql.TIMESTAMP转为java.sql.TIMESTAMP的方法

时间:2018-03-07 11:36:08   收藏:0   阅读:1217
/**
 * @reference oracle.sql.Datum.timestampValue();
 * @return
 */
private Timestamp getOracleTimestamp(Object value) {
    try {
        Class clz = value.getClass();
        Method m = clz.getMethod("timestampValue");
        //m = clz.getMethod("timeValue", null); 时间类型
        //m = clz.getMethod("dateValue", null); 日期类型
        return (Timestamp) m.invoke(value);

    } catch (Exception e) {
        return null;
    }
}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!