Incomplete information with application.getServerTimeStamp()

Servoy 2.1.1
Oracle 9i

I have a dataprovider defined as DATE on the database.
dataprovider:
fecha (Date)

If I run this on a method:

fecha = application.getServerTimeStamp();

The result on the database is: 28/10/2004 00:00:00

I was expecting: 28/10/2004 13:58:21 (With Hours, minutes, seconds !!!)

This situation used to work fine with Servoy 2.0, then with 2.1 and 2.1.1 it began to ignor the time part.

How dit you define that date field in the database?
Through the servoy dataprovider dialog?

For example if you make a global date and you do the same what do you see then?

How dit you define that date field in the database?
Through the servoy dataprovider dialog?

Nop, the field was defined allready on the database as a DATE.
I never use the Servoy Interface to create field on my database.

if I do:
globals.g_fecha = application.getServerTimeStamp();

then globals.g_fecha is ok, with time also.

DATE in a database is most of the time only the date part.
If you want a time part in youre date then you should specify a DATETIME.

Do make a DATE column in youre database through servoy itself and try again.

Oracles only uses one tipe of DATE, and it includes both info, DATE and TIME

With an SQL tool Im able to insert a table with:

28/10/2004 16:05:48

As I mentioned, something has changed on Servoy since 2.1, because on 2.0 this matter was not a problem.

I konw some databases have the DATE only for DATE and not both. but Oracle does manages the same in ONE field.

did you try to make a date column through servoy itself?
please do!

ok, Ive done so.

Same thing, no time !!!

what does oracle say what kind of column is created?

And can you start the developer with -DSTACKTRACE=TRUE:

java -DSTACKTRACE=TRUE -jar servoy_developer.jar

then when you set the timestamp and you save the data you should be able toe see what got send to oracle.

I currently don’t have an oracle install at hand so i can’t test it right away.

what does oracle say what kind of column is created?

DATE

This is what I see with -DSTACKTRACE=TRUE:

oracle: Got connection, thread=AWT-EventQueue-0
PingScanner woke up, queue [ 496b1818-2909-11d9-80a0-a12604cd58bb(1098987863901) ]
sql update AVALES set FECHAVENCIMIENTO = ?  where AVALES.ID_AVALES = ?
questiondata[0]= 2004-10-28 ,type: java.sql.Date
questiondata[1]= 0 ,type: java.math.BigDecimal
PingScanner sleeping for 294562 milliseconds, queue [ 496b1818-2909-11d9-80a0-a12604cd58bb(1098987863901) ]
oracle: Closed connection, thread=AWT-EventQueue-0

FECHAVENCIMIENTO is a DATE field, created with Servoy.

this is again a problem of the oracle driver.

Oracle returns the Types.DATE identifier for all date/time columns, see also here for more people having the same problem:
http://www.mail-archive.com/torque-user … 02925.html

and because of this all date columns are converted to java.sql.Date when inserting or when reading from the database. And then the Time portion is truncated. Oracle should return Types.TIMESTAMP for this because that is the one that defines both date and time.

I am looking for a way around this…