From: Mark Matthews <[EMAIL PROTECTED]> To: Lieven De Keyzer <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED], mysql@lists.mysql.com Subject: Re: Different TIMESTAMP columns Date: Wed, 18 May 2005 14:58:41 -0500
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
[EMAIL PROTECTED] wrote: > "Lieven De Keyzer" <[EMAIL PROTECTED]> wrote on 05/18/2005 > 03:21:02 PM: [snip]
>>Yes, I have already considered using the DATETIME, but there is no Java
>>class for this database type?
>>
>>
>>>Shawn Green
>>>Database Administrator
>>>Unimin Corporation - Spruce Pine
>>
>
> I am not sure which Java package you are using (or I would look at its
> documentation to make sure of what I am about to say) but it makes sense
> to me that an object of the Java "timestamp" class would map to a MySQL
> "datetime" field. What happens when you try that kind of match?
>
> You see, the name "timestamp" cannot not mean exactly the same thing under
> all circumstances or across different languages. This may be the case
> where what Java calls "timestamp", MySQL calls "datetime". Same data,
> different name.
Shawn,
You are correct. The MySQL JDBC drivers maps MySQL's "DATETIME" to java.sql.Timestamp.
Lieven, you might've found this section in the documentation for the JDBC driver helpful:
http://dev.mysql.com/doc/connector/j/en/cj-type-conversions.html#id2785196
-Mark
But how do I initialize the 2 datetime fields? With no DEFAULT, their values are 0000-00-00 00:00:00. Just what I wanted to avoid with TIMESTAMP
- -- Mark Matthews MySQL AB, Software Development Manager - Connectivity www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCi55wtvXNTca6JD8RAq6oAJ4xCIvt5SqpXnzf/Ye9T2fEk8XczACeLlhD T3wG44j2xM3hu9OBY0tf8Ak= =RKz+ -----END PGP SIGNATURE-----
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]