diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-06-05 23:46:50 +0400 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-06-05 23:46:50 +0400 |
commit | bb86570acc87ca082663986c2f9207d55c434623 (patch) | |
tree | bc34ee1de046b383931e895cb3bcfdc14a56bcf5 /src/org | |
parent | f442d992179fe0355177181c01cc6c7ca8bfaca1 (diff) | |
download | trackermap-server-bb86570acc87ca082663986c2f9207d55c434623.tar.gz trackermap-server-bb86570acc87ca082663986c2f9207d55c434623.tar.bz2 trackermap-server-bb86570acc87ca082663986c2f9207d55c434623.zip |
Support old config (fix #12)
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/model/DatabaseDataManager.java | 24 |
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"); |