db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [PATCH] Timestamp Arithmetic
Date Tue, 17 May 2005 23:19:14 GMT
Jack Klebanoff wrote:


> My copy of the JDBC 3.0 spec does not say what TIMESTAMPADD and
> TIMESTAMPDIFF are supposed to do when the input is a date or time.
> However the ODBC spec on Microsoft's web site specifies the above
> behavior. My understanding is that JDBC follows ODBC here.

Dumb question, but did you see TIMESTAMPADD in the ODBC spec?

Here I only see TIMESTAMPDIFF

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbctime__date__and_interval_functions.asp


>> Then the naming of the new methods in DateTimeDataValue seemed wrong,
>> I'm a great believer in ensuring such items and method names correctly
>> reflect their purpose. This makes the code more readable.
>> So we have
>>

>> It seems a more correct reflection of their names would be intervalAdd
>> and intervalDiff.
>>  
>>
> The methods implement the TIMESTAMPADD and TIMESTAMPDIFF functions, so
> their names seem appropriate to me.

But they could be used to implement more in the future, and people
looking at just that code may not understand the tie in to JDBC/ODBC
functions. We don't control how api functions are named, but we can
control how Derby functions are named to reflect their functionality.

> I think that this is a reasonable argument, but I think that we should
> follow the JDBC/ODBC standard, warts and all.

Yep, I keep forgetting that the JDBC spec is based upon the ODBC spec.

Dan.


Mime
View raw message