From f443f208a5bf7ba38cce103909cb234dbe804149 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 5 Jun 2015 16:38:53 +1200 Subject: Remove named statement class --- src/org/traccar/protocol/ApelProtocolDecoder.java | 18 ------------------ .../traccar/protocol/ProgressProtocolDecoder.java | 22 +--------------------- 2 files changed, 1 insertion(+), 39 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index 5729231a5..4b05f3004 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -73,24 +73,6 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { private static final String HEX_CHARS = "0123456789ABCDEF"; - private void loadLastIndex() { - /*try { - Properties p = getServerManager().getProperties(); - if (p.contains("database.selectLastIndex")) { - AdvancedConnection connection = new AdvancedConnection( - p.getProperty("database.url"), p.getProperty("database.user"), p.getProperty("database.password")); - NamedParameterStatement queryLastIndex = new NamedParameterStatement(connection, p.getProperty("database.selectLastIndex")); - queryLastIndex.prepare(); - queryLastIndex.setLong("device_id", deviceId); - ResultSet result = queryLastIndex.executeQuery(); - if (result.next()) { - lastIndex = result.getLong(1); - } - } - } catch(Exception error) { - }*/ - } - private void sendSimpleMessage(Channel channel, short type) { ChannelBuffer request = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 8); request.writeShort(type); diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index f2bf41398..9ec0e08eb 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -52,24 +52,6 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { private static final String HEX_CHARS = "0123456789ABCDEF"; - private void loadLastIndex() { - /*try { - Properties p = getServerManager().getProperties(); - if (p.contains("database.selectLastIndex")) { - AdvancedConnection connection = new AdvancedConnection( - p.getProperty("database.url"), p.getProperty("database.user"), p.getProperty("database.password")); - NamedParameterStatement queryLastIndex = new NamedParameterStatement(connection, p.getProperty("database.selectLastIndex")); - queryLastIndex.prepare(); - queryLastIndex.setLong("device_id", deviceId); - ResultSet result = queryLastIndex.executeQuery(); - if (result.next()) { - lastIndex = result.getLong(1); - } - } - } catch(Exception error) { - }*/ - } - private void requestArchive(Channel channel) { if (lastIndex == 0) { lastIndex = newIndex; @@ -99,9 +81,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(length); length = buf.readUnsignedShort(); String imei = buf.readBytes(length).toString(Charset.defaultCharset()); - if (identify(imei)) { - loadLastIndex(); - } + identify(imei); } // Position -- cgit v1.2.3