• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chapter 11 Message Log example modification for MySQL users

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, for MySQL users, in chapter 11's message log example,
the create message_log table command provided by the book is:

CREATE TABLE MESSAGE_LOG (ID INTEGER  NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
                          MESSAGE VARCHAR(255), LOG_DTTM TIMESTAMP, PRIMARY KEY (ID));



MySQL cannot compile "generated always as identity.
It should be modified  as:

CREATE TABLE MESSAGE_LOG (ID INTEGER  NOT NULL auto_increment, MESSAGE VARCHAR(255), LOG_DTTM TIMESTAMP, PRIMARY KEY (ID));


Also, in the LoggerBean.java, the INSERT_SQL provided by the book is:


MySQL cannot compile CURRENT TIMESTAMP, it should be modified as:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic