org.h2.Driver
jdbc:h2:/home/user/Documents/database
sa
300
Create database:
CREATE TABLE devices (id INT IDENTITY imei VARCHAR(16))
CREATE TABLE 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, is_valid, latitude, longitude, speed, course, power)
VALUES (:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power)
true
8082
false
/home/user/Documents/tracker-server.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