diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:52:33 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:52:33 +1200 |
commit | 3083db3929e27933d3ab5eab9fa0c1e221e94eec (patch) | |
tree | 15db7705ecb90dabafb8719c9b93861982a5d91b /src/org/traccar/database/ResultSetConverter.java | |
parent | 27055e0bf5f544552c227da10badff34a71cfb70 (diff) | |
download | trackermap-server-3083db3929e27933d3ab5eab9fa0c1e221e94eec.tar.gz trackermap-server-3083db3929e27933d3ab5eab9fa0c1e221e94eec.tar.bz2 trackermap-server-3083db3929e27933d3ab5eab9fa0c1e221e94eec.zip |
Implement JSON conversion
Diffstat (limited to 'src/org/traccar/database/ResultSetConverter.java')
-rw-r--r-- | src/org/traccar/database/ResultSetConverter.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/org/traccar/database/ResultSetConverter.java b/src/org/traccar/database/ResultSetConverter.java index e4aec956c..92cb8fa4e 100644 --- a/src/org/traccar/database/ResultSetConverter.java +++ b/src/org/traccar/database/ResultSetConverter.java @@ -26,8 +26,6 @@ import javax.json.JsonArrayBuilder; import javax.json.JsonObjectBuilder; public class ResultSetConverter { - - private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); public static JsonArray convert(ResultSet rs) throws SQLException { @@ -66,10 +64,10 @@ public class ResultSetConverter { obj.add(columnName, rs.getString(columnName)); break; case java.sql.Types.DATE: - obj.add(columnName, dateFormat.format(rs.getDate(columnName))); + obj.add(columnName, JsonConvertable.dateFormat.format(rs.getDate(columnName))); break; case java.sql.Types.TIMESTAMP: - obj.add(columnName, dateFormat.format(rs.getTimestamp(columnName))); + obj.add(columnName, JsonConvertable.dateFormat.format(rs.getTimestamp(columnName))); break; default: break; |