this is a kylin jdbc pool for querying kylin server using spring boot. the project link is: kylin-jdbc-pool <https://github.com/lichaojacobs/kylin-jdbc-pool|https://github.com/lichaojacobs/kylin-jdbc-pool> functions it provide a pool for kylin jdbc, and a simple ORM framework that when results returned it auto map results to models defined in your project. it also support gson SerializedName annotation to customize the property names of model class. here is the usage: 1、first configure settings: kylin: project1: userName: admin password: KYLIN decrypt: true connectionUrl: jdbc:kylin://host:7070/project1 poolSize: 10 maxWaitTime: 10000 #ms project2: userName: admin password: KYLIN decrypt: true poolSize: 10 connectionUrl: jdbc:kylin://host:7070/project2 maxWaitTime: 10000 #ms 2、then try your business RunWith(SpringRunner.class)@SpringBootTestpublic class KylinJdbcPoolApplicationTests { @Resource(name = "project1JdbcTemplate") JdbcTemplate project1JdbcTemplate; @Resource(name = "project2JdbcTemplate") JdbcTemplate project2JdbcTemplate; @Test public void test() { int countResult = project1JdbcTemplate .queryForObject("select count(*) from SCHEMA.table", (resultSet, i) -> { return resultSet.getInt(1); }); System.out.println("testResult: " + countResult); } @Test public void testRowMapper() { List demoList = project1JdbcTemplate .query("select * from from SCHEMA.table limit 10", KylinRowMapper.getDefault( Demo.class)); System.out.println(JSON.toJSONString(demoList)); }}
-- Sent from: http://apache-kylin.74782.x6.nabble.com/