Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> JDBC - Date problem with Oracle
Hi all,
I created an application that executes SQL commands and Stored Procedures over an Oracle Database. The Date type on the Server hold time information but when returned as output SP parameters or SQL query field the time part is discarded... I would like to know if this is normal or is that I am missing something...
I have been doing i.e:
CallableStatement cstatOrderIns = null;
cstatOrderIns = connection.prepareCall("{call TEST(?)}");
cstatOrderIns.registerOutParameter (1, Types.TIMESTAMP);
// have tried this bellow as well...
// cstatOrderIns.registerOutParameter (1, Types.DATE);
cstatOrderIns.execute();
GregorianCalendar insertDate = new GregorianCalendar();
insertDate.setTime(cstatOrderIns.getDate(1)); System.out.println(cstatOrderIns.getDate(1).toString()); System.out.println(insertDate.get(Calendar.HOUR) + ":" + insertDate.get(Calendar.MINUTE));
The output is always "0:0"...
Clling a TEST Stored Procedure which does something like this:
SELECT SYSTEMTIME FROM DUAL INTO OUTPARAM
Thanks in advance,
Best Regards,
Giovanni
Received on Wed Jan 16 2002 - 08:45:09 CST
![]() |
![]() |