如何使用oracle.sql.Datum从PL / SQL类型TIMESTAMP(9)WITH LOCAL TIMEZONE获取java.util.Date值

时间:2014-07-10 09:16:01

标签: java oracle plsql

我在PL / SQL中编写了一个函数,它返回一个编码器定义的对象“OBJ_FRIEND” PL / SQL代码

CREATE OR REPLACE TYPE OBJ_FRIEND IS OBJECT(
LAST_NAME VARCHAR2(100),
FIRST_NAME VARCHAR2(100),
BIRTHDATE TIMESTAMP(9) WITH LOCAL TIME ZONE
);
/

用Java检索它 Java代码

...
Datum[] datums=oracleCallableStatement.getSTRUCT(1).getOracleAttributes();
Date date=datums[2].dateValue(); //I tried timestampValue also but didn't work.

如何从基准对象中获取java.util.Date值?

0 个答案:

没有答案