public List<TrackData> getTrackDataList_History(
            List<TrackData> list_track_data, String startDate, String endDate, String vregisteration_num) {

        try {

            m_Connection = getDbConnection().getConnection();
            m_Statement = m_Connection.createStatement();
            String m_Query = "select Phone_No,cv,Latitude,Longitude,Speed,Acc_Status,location from livemessagedata where Phone_No in "
                    + "( "
                    + " select deviceid from vehicle where vregisteration_num = '" + vregisteration_num + "' "
                    + ") "
                    + "and "
                    + "cv between "
                    + "'" + startDate + "' "
                    + "and "
                    + "'" + endDate + "'";

            SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss");
            m_ResultSet = m_Statement.executeQuery(m_Query);
            log.info(m_Query);

            while (m_ResultSet.next()) {

                TrackData trackData = new TrackData();
                trackData.setDeviceid(m_ResultSet.getString("Phone_No"));
                trackData.setDate(df.format(m_ResultSet.getTimestamp("cv")));

                if (trackData.getLatitudeList().equals("")) {
                    trackData.setLatitudeList(m_ResultSet.getString("Latitude"));
                } else {
                    trackData.setLatitudeList(trackData.getLatitudeList() + "," + m_ResultSet.getString("Latitude"));
                }

                if (trackData.getLongitudeList().equals("")) {
                    trackData.setLongitudeList(m_ResultSet.getString("Longitude"));
                } else {
                    trackData.setLongitudeList(trackData.getLongitudeList() + "," + m_ResultSet.getString("Longitude"));
                }

                trackData.setLocation(m_ResultSet.getString("location"));

                trackData.setSpeed(Double.parseDouble(m_ResultSet.getString("Speed")));
                int x = Integer.parseInt(m_ResultSet.getString("Acc_Status"));
                if (x == 0) {
                    trackData.setAcc_status("OFF");
                } else {
                    trackData.setAcc_status("ON");
                }

                list_track_data.add(trackData);
            }

        } catch (SQLException sqe) {
            log.info(sqe);
        } finally {
            try {
                if (m_ResultSet != null) {
                    m_ResultSet.close();
                }
                if (m_Statement != null) {
                    m_Statement.close();
                }
                if (m_Connection != null) {
                    m_Connection.close();
                }
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
        }
        return list_track_data;
    }