aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-06-05 23:46:50 +0400
committerAnton Tananaev <anton.tananaev@gmail.com>2012-06-05 23:46:50 +0400
commitbb86570acc87ca082663986c2f9207d55c434623 (patch)
treebc34ee1de046b383931e895cb3bcfdc14a56bcf5 /src
parentf442d992179fe0355177181c01cc6c7ca8bfaca1 (diff)
downloadtraccar-server-bb86570acc87ca082663986c2f9207d55c434623.tar.gz
traccar-server-bb86570acc87ca082663986c2f9207d55c434623.tar.bz2
traccar-server-bb86570acc87ca082663986c2f9207d55c434623.zip
Support old config (fix #12)
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/model/DatabaseDataManager.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index ed3335342..733f0a0ec 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -72,22 +72,34 @@ public class DatabaseDataManager implements DataManager {
String query;
query = properties.getProperty("database.selectDevice");
- queryGetDevices = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryGetDevices = new NamedParameterStatement(connection, query);
+ }
query = properties.getProperty("database.insertDevice");
- queryAddDevice = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryAddDevice = new NamedParameterStatement(connection, query);
+ }
query = properties.getProperty("database.updateDevice");
- queryUpdateDevice = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryUpdateDevice = new NamedParameterStatement(connection, query);
+ }
query = properties.getProperty("database.deleteDevice");
- queryRemoveDevice = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryRemoveDevice = new NamedParameterStatement(connection, query);
+ }
query = properties.getProperty("database.selectPosition");
- queryGetPositions = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryGetPositions = new NamedParameterStatement(connection, query);
+ }
query = properties.getProperty("database.insertPosition");
- queryAddPosition = new NamedParameterStatement(connection, query);
+ if (query != null) {
+ queryAddPosition = new NamedParameterStatement(connection, query);
+ }
// Create database schema
query = properties.getProperty("database.initialize");