java - Calling Oracle stored procedure with DATE input doesn't set the HH:MM:SS -



java - Calling Oracle stored procedure with DATE input doesn't set the HH:MM:SS -

i'm trying phone call oracle stored procedure in java ee web application (java) using spring 'callablestatementcreator'. 1 of inputs stored procedure date.

my attributevalue java.util.date , correctly holds both dd-mm-yyyy , hh:mm:ss. when using next code:

callablestmt.settime(6, new java.sql.time(attributevalue.gettime()));

the result column in db (the stored procedure writes in db) set 1970-01-01 , right hh:mm:ss pass input. worked in previous version of application (where used jdbc lib 10.x.x.x)

if use

callablestmt.setdate(6, new java.sql.date(attributevalue.gettime()));

the dd-mm-yyyy set correctly hr set 00:00:00.

so, what's right way phone call , pass attribute stored procedure? also, debug tips?

oracle database 11g enterprise edition release 11.2.0.2.0 - 64bit production oracle jdbd lib: ojdbc6-11.2.0.3

try using timestamp:

callablestmt.settimestamp(6, new java.sql.timestamp(attributevalue.gettime()));

java oracle java-ee stored-procedures jdbc

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -