//package com.yeejoin.amos.api.householdapi.Utils;
//
//import com.taosdata.jdbc.SchemalessWriter;
//import com.taosdata.jdbc.enums.SchemalessProtocolType;
//import com.taosdata.jdbc.enums.SchemalessTimestampType;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//import java.sql.Connection;
//import java.sql.DriverManager;
//import java.sql.SQLException;
//
//@Component
//public class TdEngineUtils {
//    @Value("${tdengine-server.jdbc-url}")
//    private String url;
//    @Value("${tdengine-server.username}")
//    private String user;
//    @Value("${tdengine-server.password}")
//    private String password;
//    public  void writeDataIntoTdEngine(String lines){
//        try (Connection conn = this.getConnection()) {
//            SchemalessWriter writer = new SchemalessWriter(conn);
//            writer.write(lines, SchemalessProtocolType.JSON, SchemalessTimestampType.NOT_CONFIGURED);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//    public Connection getConnection() throws SQLException {
//        String jdbcUrl = String.format(url, user, password);
//        return DriverManager.getConnection(jdbcUrl);
//    }
//
//}
