当前位置: 首页>>代码示例>>Java>>正文


Java ExecuteContext类代码示例

本文整理汇总了Java中org.jooq.ExecuteContext的典型用法代码示例。如果您正苦于以下问题:Java ExecuteContext类的具体用法?Java ExecuteContext怎么用?Java ExecuteContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExecuteContext类属于org.jooq包,在下文中一共展示了ExecuteContext类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderEnd

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void renderEnd(ExecuteContext ctx) {
  // Only join traces, don't start them. This prevents LocalCollector's thread from amplifying.
  if (brave.serverSpanThreadBinder().getCurrentServerSpan() == null ||
      brave.serverSpanThreadBinder().getCurrentServerSpan().getSpan() == null) {
    return;
  }

  brave.clientTracer().startNewSpan(ctx.type().toString().toLowerCase());
  String[] batchSQL = ctx.batchSQL();
  if (!StringUtils.isBlank(ctx.sql())) {
    brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, ctx.sql());
  } else if (batchSQL.length > 0 && batchSQL[batchSQL.length - 1] != null) {
    brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, StringUtils.join(batchSQL, '\n'));
  }
  brave.clientTracer()
      .setClientSent(mysqlEndpoint.ipv4, mysqlEndpoint.port, mysqlEndpoint.serviceName);
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:19,代码来源:TraceZipkinMySQLStorageAutoConfiguration.java

示例2: executeEnd

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void executeEnd(ExecuteContext ctx) {
  if (brave.serverSpanThreadBinder().getCurrentServerSpan() == null ||
      brave.serverSpanThreadBinder().getCurrentServerSpan().getSpan() == null) {
    return;
  }
  brave.clientTracer().setClientReceived();
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:9,代码来源:TraceZipkinMySQLStorageAutoConfiguration.java

示例3: getTranslator

import org.jooq.ExecuteContext; //导入依赖的package包/类
private SQLExceptionTranslator getTranslator(ExecuteContext context) {
	SQLDialect dialect = context.configuration().dialect();
	if (dialect != null && dialect.thirdParty() != null) {
		return new SQLErrorCodeSQLExceptionTranslator(
				dialect.thirdParty().springDbName());
	}
	return new SQLStateSQLExceptionTranslator();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:JooqExceptionTranslator.java

示例4: handle

import org.jooq.ExecuteContext; //导入依赖的package包/类
/**
 * Handle a single exception in the chain. SQLExceptions might be nested multiple
 * levels deep. The outermost exception is usually the least interesting one (
 * "Call getNextException to see the cause."). Therefore the innermost exception is
 * propagated and all other exceptions are logged.
 * @param context the execute context
 * @param translator the exception translator
 * @param exception the exception
 */
private void handle(ExecuteContext context, SQLExceptionTranslator translator,
		SQLException exception) {
	DataAccessException translated = translate(context, translator, exception);
	if (exception.getNextException() == null) {
		context.exception(translated);
	}
	else {
		logger.error("Execution of SQL statement failed.", translated);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:20,代码来源:JooqExceptionTranslator.java

示例5: exceptionTranslation

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Test
public void exceptionTranslation() {
	ExecuteContext context = mock(ExecuteContext.class);
	Configuration configuration = mock(Configuration.class);
	given(context.configuration()).willReturn(configuration);
	given(configuration.dialect()).willReturn(this.dialect);
	given(context.sqlException()).willReturn(this.sqlException);
	this.exceptionTranslator.exception(context);
	ArgumentCaptor<RuntimeException> captor = ArgumentCaptor
			.forClass(RuntimeException.class);
	verify(context).exception(captor.capture());
	assertThat(captor.getValue()).isInstanceOf(BadSqlGrammarException.class);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:JooqExceptionTranslatorTests.java

示例6: fetchEnd

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void fetchEnd(ExecuteContext ctx) {
    super.fetchEnd(ctx);

    Pair<Long, Integer> stopWatchIntegerPair = timing.get(ctx.query().toString());
    long duration = System.nanoTime() - stopWatchIntegerPair.getValue0();
    timing.put(ctx.query().toString(), new Pair<>(duration, ctx.result().size()));
}
 
开发者ID:unipop-graph,项目名称:unipop,代码行数:9,代码来源:TimingExecuterListener.java

示例7: fetchStart

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void fetchStart(ExecuteContext ctx) {
    super.start(ctx);
    StopWatch stopWatch = new StopWatch();
    timing.put(ctx.query().toString(), new Pair<>(System.nanoTime(), 0));
    stopWatch.start();
}
 
开发者ID:unipop-graph,项目名称:unipop,代码行数:8,代码来源:TimingExecuterListener.java

示例8: getTranslator

import org.jooq.ExecuteContext; //导入依赖的package包/类
private SQLExceptionTranslator getTranslator(ExecuteContext context) {
	SQLDialect dialect = context.configuration().dialect();
	if (dialect != null) {
		return new SQLErrorCodeSQLExceptionTranslator(dialect.name());
	}
	return new SQLStateSQLExceptionTranslator();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:8,代码来源:JooqExceptionTranslator.java

示例9: renderEnd

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void renderEnd(ExecuteContext ctx)
{
    if (database.getDatabaseConfig().logDatabaseQueries)
    {
        database.getLog().debug(ctx.query().getSQL());
    }
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:9,代码来源:JooqLogger.java

示例10: start

import org.jooq.ExecuteContext; //导入依赖的package包/类
@Override
public void start(final ExecuteContext ctx) {
  System.err.println("Query: " + ctx.query().getSQL());
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:5,代码来源:Helper.java

示例11: translate

import org.jooq.ExecuteContext; //导入依赖的package包/类
private DataAccessException translate(ExecuteContext context,
		SQLExceptionTranslator translator, SQLException exception) {
	return translator.translate("jOOQ", context.sql(), exception);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:JooqExceptionTranslator.java


注:本文中的org.jooq.ExecuteContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。