Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread hsv
 2013/08/21 18:03 -0400, Nick Khamis 
We have the following mysql timetampe field

startdate | timestamp | NO   | | -00-00 00:00:00

When trying to insert a long value in there:

Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
c.getTimeInMillis();

We are presented with the following error:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect
datetime value: '1377119243640' for column 'stopdate' at row 1

Ugh, where is the SQL?

In any case, although it looks as if that is MySQL s internal TIMESTAMP 
representation, one does not directly use Unix timestamps; instead, one 
converts them with the MySQL function FROM_UNIXTIME.

The same effect may be gotten with any timestamp-formatting function that 
yields a string in the form '2013/08/21 18:03:00' (it is all one whether the 
separator is hyphen, slant, colon, ...).


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread Michael Dykman
Nick,

You should have answered your own question in the text.

The MySql TIMESTAMP type is, as all other timestamps in the *nix
world, a count of seconds since epoch time.  The Java function you are
using yields MILLI-seconds.  Divide it by 1000 and you should be good
to go.


On Wed, Aug 21, 2013 at 6:03 PM, Nick Khamis  wrote:
> Hello Everyone,
>
> We have the following mysql timetampe field
>
> startdate | timestamp | NO   | | -00-00 00:00:00
>
> When trying to insert a long value in there:
>
> Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
> c.getTimeInMillis();
>
> We are presented with the following error:
>
> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect
> datetime value: '1377119243640' for column 'stopdate' at row 1
>
>
> Our environments is:
>
> JDBC Driver = 5.1.26
> Mysql = 5.5
>
>
> show variables like 'time_zone%';
> +---++
> | Variable_name | Value  |
> +---++
> | time_zone | +00:00 |
> +---++
>
> SELECT @@global.sql_mode;
> +---+
> | @@global.sql_mode |
> +---+
> |   |
> +---+
>
> Not sure why I am getting this error.
>
>
> Thanks in Advance,
>
> Nick.



-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread Nick Khamis
Hello Everyone,

We have the following mysql timetampe field

startdate | timestamp | NO   | | -00-00 00:00:00

When trying to insert a long value in there:

Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
c.getTimeInMillis();

We are presented with the following error:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect
datetime value: '1377119243640' for column 'stopdate' at row 1


Our environments is:

JDBC Driver = 5.1.26
Mysql = 5.5


show variables like 'time_zone%';
+---++
| Variable_name | Value  |
+---++
| time_zone | +00:00 |
+---++

SELECT @@global.sql_mode;
+---+
| @@global.sql_mode |
+---+
|   |
+---+

Not sure why I am getting this error.


Thanks in Advance,

Nick.


Re: MySQL version 3.23 to 5.x features

2013-08-21 Thread Jesper Wisborg Krogh

Hi Naga,

On 21/08/2013 23:43, shawn green wrote:

Hello Naga,

On 8/21/2013 6:45 AM, Nagaraj S wrote:

Hello,

Can anyone share the features/comparison from MySQL version 3.23 to 
5.x in

single document? I can get from Google, however I have to navigate
different pages/sites, if it is in single document that will be 
useful to

see the overview of mysql features



While not exactly just one single page for all changes, there is a 
single page of the fine manual within each new major version that 
describes the big features that are new or changed within that version.


Just to add one reference to Shawn's list, there is also a MySQL Server 
Version Reference at 
https://dev.mysql.com/doc/mysqld-version-reference/en/index.html. It is 
lower level such as which options and functions are available in each 
major version. However it does not start out before version 5.0, so will 
not help you over the 3.23 -> 4.0 -> 5.0 hurdle.


Best regards,
Jesper Krogh
MySQL Support

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: MySQL version 3.23 to 5.x features

2013-08-21 Thread shawn green

Hello Naga,

On 8/21/2013 6:45 AM, Nagaraj S wrote:

Hello,

Can anyone share the features/comparison from MySQL version 3.23 to 5.x in
single document? I can get from Google, however I have to navigate
different pages/sites, if it is in single document that will be useful to
see the overview of mysql features



While not exactly just one single page for all changes, there is a 
single page of the fine manual within each new major version that 
describes the big features that are new or changed within that version.


http://dev.mysql.com/doc/refman/5.0/en/mysql-nutshell.html
http://dev.mysql.com/doc/refman/5.1/en/mysql-nutshell.html
http://dev.mysql.com/doc/refman/5.5/en/mysql-nutshell.html
http://dev.mysql.com/doc/refman/5.6/en/mysql-nutshell.html

Unfortunately, to learn what we changed between 3.23 -> 4.0 or between 
4.0 -> 4.1, you are going to need to review the change logs

http://dev.mysql.com/doc/refman/4.1/en/news.html


from http://dev.mysql.com/doc/refman/4.1/en/index.html

This manual describes features that are not included in every edition of 
MySQL 3.23, MySQL 4.0, and MySQL 4.1; such features may not be included 
in the edition of MySQL 3.23, MySQL 4.0, or MySQL 4.1; licensed to you.




I can pretty much summarize the deficiencies in 3.23 like this
* No InnoDB, Archive, CSV, Federated, or Blackhole storage engines
* No table partitioning
* No Views
* No Stored Procedures or Stored Functions
* No Triggers
* No Events
* Severe scalability limits (won't run as fast with reasonably 
concurrent loads even on great hardware as later versions)

* Completely out of print (unpublished) and unsupported.
* Missing literally thousands of bug fixes and performance improvements


Any new project should be starting out with 5.6.  Any production server 
should be on 5.5 or 5.6 by now or migrating soon. It is also a fairly 
safe bet that if you are still operating a 3.23 instance of MySQL that 
it is also time to upgrade your hardware.


Regards,
--
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



MySQL version 3.23 to 5.x features

2013-08-21 Thread Nagaraj S
Hello,

Can anyone share the features/comparison from MySQL version 3.23 to 5.x in
single document? I can get from Google, however I have to navigate
different pages/sites, if it is in single document that will be useful to
see the overview of mysql features

-Naga