What is "HikariCP"?

光 HikariCP・A solid, high-performance, JDBC connection pool at last. in short, it's library for JDBC connection pool, it make you easier manage your  JDBC connection pool.

Using HikariCP integrate Clickhouse, there are three steps.

  1. config Clickhouse datasource url/username/password on the yml file, it also set this information on Vault, it depends on you.
  2. create the config class on SpringBoot, this class will read Clickhouse configuration on yml file, and establish connection.
  3. this step is optional, create JdbcTemplate, it is easy for query clickhouse

First step

config yml file

spring:
  datasource:
    clickhouse:type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.clickhouse.jdbc.ClickHouseDriver
    jdbc-url: jdbc:clickhouse://xxxxx
    username: abc
    password: abc

Second step

create config class

@Configuration
class ClickHouseDataSourceConfig {
    @Bean
    @ConfigurationProperties(prefix = "spring.datasource.clickhouse")
    fun clickhouseDataSource(
            @Value("${spring.datasource.clickhouse.username}") username: String,
            @Value("${spring.datasource.clickhouse.password}") password: String
    ): DataSource = DataSourceBuilder.create().type(HikariDataSource::class.java).build().apply {
        this.username = username
        this.password = password
        this.isReadOnly = true
    @Bean("clickhouseJdbcTemplate") //create JdbcTemplate,optional
    fun clickhouseJdbcTemplate(@Qualifier("clickhouseDataSource") dataSource: DataSource): JdbcTemplate =
        JdbcTemplate(dataSource)
}

that's all

1. 在yml文件配置clickhouse的url,用户名密码,也可以将这些配置到vault上,这个取决你. 2. 创建对应的config class, 读取yml文件配置 3. 创建对应的JdbcTemplate(optional) 配置yml文件: spring: datasource: clickhouse:type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.clickhouse.jdbc.ClickHouseDriver jdbc-url: jdbc:clickhouse://xxxxx username: abc 1 min read
1. 编译Chromium时默认是不支持MP3,MP4格式的,所以编译出来的版本是无法播放音频和视频的,如果要播放时,就会产生这样的error log: PIPELINE_ERROR DEMUXER_ERROR_NO_SUPPORTED_STREAM 如果需要对音视频进行支持的话,需要在args.gn文件中,增加如下的配置: proprietary_codecs = true ffmpeg_branding = "Chrome" 这样重新编译之后就可以播放视频了. google group讨论区原贴Does anyone know how Chrome for Android or Android Webview plays facebooks videos? [https://groups.google.com/a/chromium.org/forum/#!topic/
1 min read
当你尝试在WSL上运行32位的程序时,shell将会报错:cannot execute binary file: Exec format error. 这是因为WSL目前暂不支持32位的ELF可执行文件。 在命令行中加入下面代码就可以了 sudo apt install qemu-user-static sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\