aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/DatabaseDataManager.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index c5492bc8a..ece8014ce 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -87,6 +87,16 @@ public class DatabaseDataManager implements DataManager {
query = properties.getProperty("database.insertPosition");
queryAddPosition = new NamedParameterStatement(connection, query);
+
+ // Create database schema
+ query = properties.getProperty("database.initialize");
+ if (query != null) try {
+ NamedParameterStatement initializeQuery = new NamedParameterStatement(connection, query);
+ initializeQuery.prepare();
+ initializeQuery.executeUpdate();
+ } catch (Exception error) {
+ System.out.println(error.getMessage());
+ }
}
public synchronized List<Device> getDevices() throws SQLException {