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

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

There is a newer version: 3.4.0
Show newest version
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, String topic, String dbName) throws SQLException {
        Map map = new HashMap<>();

        ResultSetMetaData metaData = data.getMetaData();
        for (int i = 1; i <= metaData.getColumnCount(); i++) {
            map.put(metaData.getColumnLabel(i), data.getObject(i));
        }

        return map;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy