package com.elab.es.jdbc;

/**
 * @Module TODO
 * @Description TODO
 * @Author liukaixiong
 * @Date 2021/1/28 16:47
 */
public class JdbcTest {

    public void testJDBC() throws Exception {
//        Properties properties = new Properties();
//        properties.put("url", "jdbc:elasticsearch://127.0.0.1:9300/" + TestsConstants.TEST_INDEX);
//        DruidDataSource dds = (DruidDataSource) ElasticSearchDruidDataSourceFactory.createDataSource(properties);
//        Connection connection = dds.getConnection();
//        PreparedStatement ps = connection.prepareStatement("SELECT  gender,lastname,age from  " + TestsConstants.TEST_INDEX + " where lastname='Heath'");
//        ResultSet resultSet = ps.executeQuery();
//        List<String> result = new ArrayList<String>();
//        while (resultSet.next()) {
//            System.out.println(resultSet.getString("lastname") + "," + resultSet.getInt("age") + "," + resultSet.getString("gender"))
//        }
//        ps.close();
//        connection.close();
//        dds.close();
    }
}
