org.h2.Driver
jdbc:h2:[DATABASE]
sa
300
CREATE TABLE IF NOT EXISTS devices (id INT IDENTITY, imei VARCHAR(16));
CREATE TABLE IF NOT EXISTS positions (device_id INT, time TIMESTAMP, valid BOOLEAN, latitude DOUBLE, longitude DOUBLE, speed DOUBLE, course DOUBLE, power DOUBLE, mode INT);
id - Integer
imei - String
<-->
SELECT id, imei
FROM devices
imei - String
<-->
INSERT INTO devices (imei)
VALUES (:imei)
id - Integer
imei - String
<-->
UPDATE devices
SET imei = :imei
WHERE id = :id
id - Integer
<-->
DELETE FROM devices
WHERE id = :id
device_id - Integer
<-->
SELECT *
FROM positions
WHERE device_id = :device_id
device_id - Integer
time - Date
valid - Boolean
latitude - Double
longitude - Double
speed - Double
course - Double
power - Double (NULL for some protocols)
mode - Integer
extended_info - String (XML)
<-->
INSERT INTO positions (device_id, time, valid, latitude, longitude, speed, course, power)
VALUES (:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power, :mode)
true
8082
true
[LOG]
true
5000
0
true
5001
0
true
5002
0
true
5003
0
true
5004
0
true
5005
0
true
5006
0
true
5007
0
true
5008
0
true
5009
0
true
5010
0