org.jdbi.v3.core.Jdbi.installPlugins()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.jdbi.v3.core.Jdbi.installPlugins()方法的一些代码示例,展示了Jdbi.installPlugins()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jdbi.installPlugins()方法的具体详情如下:
包路径:org.jdbi.v3.core.Jdbi
类名称:Jdbi
方法名:installPlugins

Jdbi.installPlugins介绍

[英]Use the ServiceLoader API to detect and install plugins automagically. Some people consider this feature dangerous; some consider it essential -- use at your own risk.
[中]使用ServiceLoader API自动检测和安装插件。有些人认为这个特点是危险的;有些人认为这是必要的--使用你自己的风险。

代码示例

代码示例来源:origin: jdbi/jdbi

@Override
protected Jdbi createInstance() throws Exception {
  final Jdbi jdbi = Jdbi.create(new SpringConnectionFactory(dataSource));
  if (autoInstallPlugins) {
    jdbi.installPlugins();
  }
  plugins.forEach(jdbi::installPlugin);
  globalDefines.forEach(jdbi::define);
  return jdbi;
}

代码示例来源:origin: jdbi/jdbi

@Override
public void before() throws Throwable {
  if (migration != null) {
    final Flyway flyway = new Flyway();
    flyway.setDataSource(getDataSource());
    flyway.setLocations(migration.paths.toArray(new String[0]));
    flyway.setSchemas(migration.schemas.toArray(new String[0]));
    flyway.migrate();
  }
  jdbi = Jdbi.create(getDataSource());
  if (installPlugins) {
    jdbi.installPlugins();
  }
  plugins.forEach(jdbi::installPlugin);
  handle = jdbi.open();
}

代码示例来源:origin: jdbi/jdbi

@Override
protected void before() throws Throwable {
  db = Jdbi.create(uri);
  if (installPlugins) {
    db.installPlugins();
  }
  plugins.forEach(db::installPlugin);
  sharedHandle = db.open();
  con = sharedHandle.getConnection();
  try (Statement s = con.createStatement()) {
    // TODO legacy...
    s.execute("create table something (id identity primary key, name varchar(50), integerValue integer, intValue integer)");
  }
}

代码示例来源:origin: jdbi/jdbi

@Override
protected void before() {
  db = Jdbi.create(uri);
  if (installPlugins) {
    db.installPlugins();
  }
  plugins.forEach(db::installPlugin);
  sharedHandle = db.open();
  con = sharedHandle.getConnection();
}

代码示例来源:origin: org.jdbi/jdbi3-spring4

@Override
protected Jdbi createInstance() throws Exception {
  final Jdbi jdbi = Jdbi.create(new SpringConnectionFactory(dataSource));
  if (autoInstallPlugins) {
    jdbi.installPlugins();
  }
  plugins.forEach(jdbi::installPlugin);
  globalDefines.forEach(jdbi::define);
  return jdbi;
}

相关文章