diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-18 21:51:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-18 21:51:56 +1300 |
commit | a01f9f7582cd7a25721be82df578d212fda4b5cc (patch) | |
tree | 006a06526ea5b8cdf09c6ba2b9a121ce3e79dc14 | |
parent | cdc98904fef47f01a7311eca17eeae97dd5e4fac (diff) | |
download | traccar-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.tar.gz traccar-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.tar.bz2 traccar-server-a01f9f7582cd7a25721be82df578d212fda4b5cc.zip |
Improve query preparation method
-rw-r--r-- | src/org/traccar/helper/NamedParameterStatement.java | 11 |
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; + } } } |