Skip to content

Instantly share code, notes, and snippets.

@hoangtranwork
Created August 1, 2016 04:12
Show Gist options
  • Save hoangtranwork/b6ebc1d64f5c858945c157d8fa5d0def to your computer and use it in GitHub Desktop.
Save hoangtranwork/b6ebc1d64f5c858945c157d8fa5d0def to your computer and use it in GitHub Desktop.
create connectionSource with MySQL driver v6
/**
* The data source instance that need to be public so we can close it in on-app-exit hook
*/
private DataSource initDataSource(HikariConfig config) {
return new HikariDataSource(config);
}
private ConnectionSource initConnectionSource(DataSource ds) throws SQLException {
return new DataSourceConnectionSource(ds, new MySql6DbType());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment