aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-01-18 21:51:56 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-01-18 21:51:56 +1300
commita01f9f7582cd7a25721be82df578d212fda4b5cc (patch)
tree006a06526ea5b8cdf09c6ba2b9a121ce3e79dc14 /src
parentcdc98904fef47f01a7311eca17eeae97dd5e4fac (diff)
downloadtrackermap-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.tar.gz
trackermap-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.tar.bz2
trackermap-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.zip
Improve query preparation method
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/helper/NamedParameterStatement.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/org/traccar/helper/NamedParameterStatement.java b/src/org/traccar/helper/NamedParameterStatement.java
index 500fbe4b3..f507a4cf8 100644
--- a/src/org/traccar/helper/NamedParameterStatement.java
+++ b/src/org/traccar/helper/NamedParameterStatement.java
@@ -128,10 +128,13 @@ public class NamedParameterStatement {
} else if (statement.getWarnings() != null) {
reset(true);
}
- } catch (SQLException error) {
- Log.info("Exception during query preparation");
- Log.warning(error.getMessage());
- reset(true);
+ } catch (SQLException firstError) {
+ try {
+ reset(true);
+ } catch (SQLException secondError) {
+ Log.info("Exception during query preparation");
+ throw secondError;
+ }
}
}