All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.taosdata.jdbc.tmq.MapDeserializer Maven / Gradle / Ivy

package com.taosdata.jdbc.tmq;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

public class MapDeserializer implements Deserializer> {
    @Override
    public Map deserialize(ResultSet data) {
        Map map = new HashMap<>();

        try {
            ResultSetMetaData metaData = data.getMetaData();
            for (int i = 1; i <= metaData.getColumnCount(); i++) {
                map.put(metaData.getColumnLabel(i), data.getObject(i));
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

        return map;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy