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.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index 384d87828..7521828a3 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -15,8 +15,7 @@
*/
package org.traccar.model;
-import java.sql.ResultSet;
-import java.sql.SQLException;
+import java.sql.*;
import java.util.*;
import org.traccar.helper.AdvancedConnection;
import org.traccar.helper.Log;
@@ -130,7 +129,7 @@ public class DatabaseDataManager implements DataManager {
public synchronized void addDevice(Device device) throws SQLException {
- queryAddDevice.prepare();
+ queryAddDevice.prepare(Statement.RETURN_GENERATED_KEYS);
queryAddDevice.setString("imei", device.getImei());
queryAddDevice.executeUpdate();