Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> JDBC - Date problem with Oracle

JDBC - Date problem with Oracle

From: Giovanni Azua <giovanni.azua_at_dsgroup.it>
Date: Wed, 16 Jan 2002 15:45:09 +0100
Message-ID: <a243da$ung0u$1@ID-114658.news.dfncis.de>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US