From a01f9f7582cd7a25721be82df578d212fda4b5cc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Jan 2013 21:51:56 +1300 Subject: Improve query preparation method --- src/org/traccar/helper/NamedParameterStatement.java | 11 +++++++---- 1 file 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; + } } } -- cgit v1.2.3