aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/NamedParameterStatement.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/helper/NamedParameterStatement.java')
-rw-r--r--src/org/traccar/helper/NamedParameterStatement.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/helper/NamedParameterStatement.java b/src/org/traccar/helper/NamedParameterStatement.java
index a4b1a12c6..0dfbb9551 100644
--- a/src/org/traccar/helper/NamedParameterStatement.java
+++ b/src/org/traccar/helper/NamedParameterStatement.java
@@ -107,17 +107,21 @@ public class NamedParameterStatement {
return parsedQuery.toString();
}
- public void prepare() throws SQLException {
+ public void prepare(int autoGeneratedKeys) throws SQLException {
try {
if (statement == null) {
- statement = connection.getInstance().prepareStatement(parsedQuery);
+ statement = connection.getInstance().prepareStatement(parsedQuery, autoGeneratedKeys);
}
} catch (SQLException error) {
connection.reset();
- statement = connection.getInstance().prepareStatement(parsedQuery);
+ statement = connection.getInstance().prepareStatement(parsedQuery, autoGeneratedKeys);
}
}
+ public void prepare() throws SQLException {
+ prepare(Statement.NO_GENERATED_KEYS);
+ }
+
/**
* Execute query with result
*/