From 5c25c48c8db367097f5ee1e9bf6d7e5435e8665a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Jul 2015 11:33:31 +1200 Subject: Ignore XML in other column --- src/org/traccar/database/QueryBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 4afa5b992..9fb92a17f 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Map; import javax.json.Json; import javax.json.JsonReader; +import javax.json.stream.JsonParsingException; import javax.sql.DataSource; import org.traccar.model.Factory; import org.traccar.model.MiscFormatter; @@ -273,7 +274,7 @@ public class QueryBuilder { } public Collection executeQuery(T prototype) throws SQLException { - List result = new LinkedList(); + List result = new LinkedList<>(); if (query != null) { @@ -372,7 +373,7 @@ public class QueryBuilder { public void process(T object, ResultSet resultSet) throws SQLException { try (JsonReader reader = Json.createReader(new StringReader(resultSet.getString(name)))) { method.invoke(object, MiscFormatter.fromJson(reader.readObject())); - } catch (IllegalAccessException | InvocationTargetException error) { + } catch (IllegalAccessException | InvocationTargetException | JsonParsingException error) { } } }); -- cgit v1.2.3