0
我執行在嵌入式數據庫H2這個SQL H2說法,但我得到了一個錯誤:無法執行H2聲明
Factory method 'dataSource' threw exception; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #13 of class path resource [db/H2.data.sql]: insert into T_DEVICE_EVENT (ID, DEVICE_ID, LATITUDE, LONGITUDE, MESSAGE, DATE_RECEIVED, RSSI, BATTERY, ALARM, PROCESSED) values (1,1,50.834015,4.377885,'71',CURRENT_TIMESTAMP(),70,50,0,1); nested exception is java.sql.SQLSyntaxErrorException: unexpected token: (required:)
表
CREATE TABLE IF NOT EXISTS t_device_event (
id bigint PRIMARY KEY,
device_id bigint NOT NULL,
latitude decimal NULL,
longitude decimal NULL,
message varchar(100) ,
date_received timestamp,
rssi float,
battery int,
alarm boolean,
processed boolean,
FOREIGN KEY (device_id) REFERENCES public.t_device(id));