<rude-but-true>if you are making a change shouldn't you be the one who
provides the explanation?</rude-but-true>
Anyway. Let's read jvadoc for java.sql.Timestamp:
<javadoc>
public class Timestamp
extends Date
A thin wrapper around java.util.Date that allows the JDBC API to identify
this as an SQL TIMESTAMP value. It adds the ability to hold the SQL
TIMESTAMP nanos value and provides formatting and parsing operations to
support the JDBC escape syntax for timestamp values.
Note: This type is a composite of a java.util.Date and a separate
nanoseconds value. Only integral seconds are stored in the java.util.Date
component. The fractional seconds - the nanos - are separate. The getTime
method will return only integral seconds. If a time value that includes the
fractional seconds is desired, you must convert nanos to milliseconds
(nanos/1000000) and add this to the getTime value. The
Timestamp.equals(Object) method never returns true when passed a value of
type java.util.Date because the nanos component of a date is unknown. As a
result, the Timestamp.equals(Object) method is not symmetric with respect to
the java.util.Date.equals(Object) method. Also, the hashcode method uses the
underlying java.util.Data implementation and therefore does not include
nanos in its computation. Due to the differences between the Timestamp class
and the java.util.Date class mentioned above, it is recommended that code
not view Timestamp values generically as an instance of java.util.Date. The
inheritance relationship between Timestamp and java.util.Date really denotes
implementation inheritance, and not type inheritance.
</javadoc>
so jdbc timestamp is nothing more than a date with nanos.
in contrast, MSSQL's TIMESTAMP column is nothing else but a unique "stamp".
a little MSSQL server documentation:
<docs>
timestamp
timestamp is a data type that exposes automatically generated binary
numbers, which are guaranteed to be unique within a database. timestamp is
used typically as a mechanism for version-stamping table rows. The storage
size is 8 bytes.
Remarks
The Transact-SQL timestamp data type is not the same as the timestamp data
type defined in the SQL-92 standard. The SQL-92 timestamp data type is
equivalent to the Transact-SQL datetime data type.
</docs>
as you can see these two "timestamps" have nothing to do with each other
besides names.
to add to that, jdbc metadata reports columns declared as DATETIME in SQL
server as java.sql.Timestamp, so that is what Torque's JDBC task dumps, and
I think this is entirely correct.
do you need any more information?
fedor.
PS. On the rude side: I admit you do not have a MS SQL installation handy
(lucky you are), so why make changes you have no idea about and noone asked
for?
-------------------------------
Any expressions expressed here only express my own expressions.
> -----Original Message-----
> From: Daniel Rall [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 16, 2001 7:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: cvs commit:
> jakarta-turbine-torque/src/templates/sql/base/mss ql db.props
>
>
> Why should a JDBC TIMESTAMP map to a MS SQL-native DATETIME? Fedor,
> it would be very helpful if you would start substantiating your
> comments. I will certainly change it back if you can provide a lucid
> explanation of why.
>
> Thanks, Daniel
>
>
> Fedor Karpelevitch <[EMAIL PROTECTED]> writes:
>
> > OVERDONE :-)
> >
> > TIMESTAMP should be DATETIME too.
> >
> > could you please fix it since you've started it.
> >
> > thanks.
> >
> > fedor.
> >
> > -------------------------------
> > Any expressions expressed here only express my own expressions.
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, August 16, 2001 1:49 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: cvs commit:
> > > jakarta-turbine-torque/src/templates/sql/base/mssql
> > > db.props
> > >
> > >
> > > dlr 01/08/16 13:48:44
> > >
> > > Modified: src/templates/sql/base/mssql db.props
> > > Log:
> > > * Added correction by Artem Grinshtein <[EMAIL PROTECTED]>:
> > >
> > > "Mapping TIME to TIMESTAMP is wrong for MSSQL-database.
> > > The value of a timestamp column is unique within a
> > > MSSQL-database and updated every time a row
> > > containing a timestamp column is inserted or updated.
> > >
> > > The correct solution is
> > > TIME = DATETIME"
> > >
> > > * Changed mapping for JDBC TIMESTAMP from native data type
> > > DATETIME to
> > > TIMESTAMP.
> > >
> > > Revision Changes Path
> > > 1.2 +2 -2
> > > jakarta-turbine-torque/src/templates/sql/base/mssql/db.props
> > >
> > > Index: db.props
> > >
> ===================================================================
> > > RCS file:
> > > /home/cvs/jakarta-turbine-torque/src/templates/sql/base/mssql/
> > > db.props,v
> > > retrieving revision 1.1
> > > retrieving revision 1.2
> > > diff -u -u -r1.1 -r1.2
> > > --- db.props 2001/08/02 05:08:40 1.1
> > > +++ db.props 2001/08/16 20:48:44 1.2
> > > @@ -15,8 +15,8 @@
> > > VARCHAR = VARCHAR
> > > LONGVARCHAR = TEXT
> > > DATE = DATETIME
> > > -TIME = TIMESTAMP
> > > -TIMESTAMP = DATETIME
> > > +TIME = DATETIME
> > > +TIMESTAMP = TIMESTAMP
> > > BINARY = BINARY
> > > VARBINARY = IMAGE
> > > LONGVARBINARY = IMAGE
> > >
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]