From 4f5f815f88e81000510ef2544e3e392fd7465d8e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 9 Oct 2014 13:24:47 +1300 Subject: Integrate c3p0 database library --- .../traccar/protocol/ProgressProtocolDecoder.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/org/traccar/protocol/ProgressProtocolDecoder.java') diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index c4a4d5e6f..85680c039 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,9 @@ package org.traccar.protocol; import java.nio.ByteOrder; import java.nio.charset.Charset; -import java.sql.ResultSet; import java.util.Calendar; import java.util.LinkedList; import java.util.List; -import java.util.Properties; import java.util.TimeZone; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; @@ -29,9 +27,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; -import org.traccar.helper.AdvancedConnection; import org.traccar.helper.Log; -import org.traccar.helper.NamedParameterStatement; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -63,11 +59,8 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { private static final String HEX_CHARS = "0123456789ABCDEF"; - /** - * Hack to load last index from database - */ private void loadLastIndex() { - try { + /*try { Properties p = getServerManager().getProperties(); if (p.contains("database.selectLastIndex")) { AdvancedConnection connection = new AdvancedConnection( @@ -81,7 +74,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { } } } catch(Exception error) { - } + }*/ } /** @@ -100,13 +93,8 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { } } - /** - * Decode message - */ @Override - protected Object decode( - ChannelHandlerContext ctx, Channel channel, Object msg) - throws Exception { + protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; int type = buf.readUnsignedShort(); -- cgit v1.2.3