HSQLDB日期型字段使用注意事項

2021-08-22 08:08:49 字數 371 閱讀 2885

date型別用於儲存日期('yyyy-mm-dd'),time型別用於儲存時間('hh:mm:ss'),datetime或timestamp用於儲存日期和時間。不能用錯了。有些資料庫time型別可以存date,但是hsqldb不行。

可以給datatime型別乙個預設值:

sql **

create cached table directories (   

dir_id identity not

null,   

directory varchar(255) not

null,   

time

timestamp

default 'now'   

);  

Mysql enum欄位使用注意

mysql enum欄位程式設計 防坑 指南 mysql資料庫中的字段型別enum可以是指字段的區間範圍,從而避免向資料庫中插入意想不到的值,固然這給資料庫設計者來了方便,但容易給程式設計人員的帶來程式編寫上的bug。因此,程式設計師需要深 刻了解enum的特徵與特點才能在程式設計是避免不必要的bu...

泛型使用注意事項

引數化型別可以引用乙個原始型別的物件,編譯報告警告,例如,collectionc new vector 可不可以,不就是編譯器一句話的事嗎?原始型別可以引用乙個引數化型別的物件,編譯報告警告,例如,collection c new vector 原來的方法接受乙個集合引數,新的型別也要能傳進去 引數...

JS中Date日期物件的使用和注意

var te 1524623451421 var time new date te 1000 時間戳為10位需 1000 var time new date te 時間戳為13位的話不需乘1000 獲取年 月 日 時 分 秒 var y time.getfullyear var m time.get...