org.h2.Driver
jdbc:h2:/home/user/Documents/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);
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)
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);
true
8082
false
true
/home/user/Documents/tracker-server.log
true
5000
true
5001
true
5002
true
5003
true
5004
true
5005
true
5006
true
5007
true
5008
true
5009
true
5010
true
5011