• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

MySQL table last update

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MySQL keeps track of last update made on table. This feature does not work if MySQL is running on windows platform or if database uses INNODB.
While running application needs to know that feature is not supported.
In phpmyadmin I saw system variables "storage engine" and "version compile os" that hold information about that.
So how can I get values of these variables from java, or is there other solutions of getting to know these values? Maybe by DatabaseMetaData?

Thanks
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just query the MySQL and read the results, which tell you which storage engine is being used for which schema.
About SQL query, read:
http://www.electrictoolbox.com/mysql-table-storage-engine/
 
Alaneus Kingingestingest
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but do you know how to read platform on which is MySQL (Win, Mac, Linux)?
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, I don't know nor Google search show any hint. You gotta find out the other way, like reading the system info of db server.
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to automatically store the row update time on a MySQL Table Row, you can have a column like this on the table:

`modified` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

The modified column is automatically updated, if a new row is inserted OR that row is updated.
 
Alaneus Kingingestingest
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for help, I found that you can use something like:

for getting system variables
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic