@@ -0,0 +1,2251 @@
+package org.openforis.collect.android.util.persistence;%0A%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Timestamp;%0Aimport java.text.ParseException;%0Aimport java.text.SimpleDateFormat;%0A%0Aimport static java.util.Locale.ENGLISH;%0A%0Apublic class ResultSetHelper %7B%0A%0A    private static final SimpleDateFormat%5B%5D TIMESTAMP_FORMATTERS = new SimpleDateFormat%5B%5D %7B%0A            new SimpleDateFormat(%22yyyy-MM-dd hh:mm:ss.S%22, ENGLISH), //default timestamp format%0A            new SimpleDateFormat(%22yyyy-MM-dd hh:mm:ss%22, ENGLISH)%7D; //for timestamp set with CURRENT_TIMESTAMP%0A%0A    private final ResultSet rs;%0A%0A    public ResultSetHelper(ResultSet rs) %7B%0A        this.rs = rs;%0A    %7D%0A%0A    public Integer getInteger(String columnName) throws SQLException %7B%0A        int value = rs.getInt(columnName);%0A        if (rs.wasNull())%0A            return null;%0A        return value;%0A    %7D%0A%0A    public Long getLong(String columnName) throws SQLException %7B%0A        long value = rs.getLong(columnName);%0A        if (rs.wasNull())%0A            return null;%0A        return value;%0A    %7D%0A%0A    public Double getDouble(String columnName) throws SQLException %7B%0A        double value = rs.getDouble(columnName);%0A        if (rs.wasNull())%0A            return null;%0A        return value;%0A    %7D%0A%0A    public Boolean getBoolean(String columnName) throws SQLException %7B%0A        boolean value = rs.getBoolean(columnName);%0A        if (rs.wasNull())%0A            return null;%0A        return value;%0A    %7D%0A%0A    public Timestamp getTimestamp(String columnName) throws SQLException %7B%0A        //TODO use newer version of SQLDroid%0A        // current version 1.0.3 has a bug: it doesn't consider missing milliseconds in timestamp%0A        //return rs.getTimestamp(columnName);%0A%0A        String timestampStr = rs.getString(columnName);%0A%0A        if (timestampStr == null) %7B%0A            return null;%0A        %7D else %7B%0A            for (SimpleDateFormat formatter: TIMESTAMP_FORMATTERS)%0A                try %7B%0A                    java.util.Date parsedTimestamp = formatter.parse(timestampStr);%0A                    return new Timestamp(parsedTimestamp.getTime());%0A                %7D catch (ParseException e) %7B%0A                    //DO NOTHING%0A                %7D%0A            return null;%0A        %7D%0A    %7D%0A%7D%0A

Add helper class