• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Chapter 11 Message Log example modification for MySQL users

 
Ranch Hand
Posts: 1749
12
  • 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:
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!