Codota Logo
SQLExecuteTemplate
Code IndexAdd Codota to your IDE (free)

How to use
SQLExecuteTemplate
in
org.apache.shardingsphere.core.executor.sql.execute

Best Java code snippets using org.apache.shardingsphere.core.executor.sql.execute.SQLExecuteTemplate (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: apache/incubator-shardingsphere

/**
 * Execute group.
 *
 * @param sqlExecuteGroups SQL execute groups
 * @param callback SQL execute callback
 * @param <T> class type of return value
 * @return execute result
 * @throws SQLException SQL exception
 */
public <T> List<T> executeGroup(final Collection<ShardingExecuteGroup<? extends StatementExecuteUnit>> sqlExecuteGroups, final SQLExecuteCallback<T> callback) throws SQLException {
  return executeGroup(sqlExecuteGroups, null, callback);
}

origin: apache/incubator-shardingsphere

public JDBCExecuteEngine(final BackendConnection backendConnection, final JDBCExecutorWrapper jdbcExecutorWrapper) {
  this.backendConnection = backendConnection;
  this.jdbcExecutorWrapper = jdbcExecutorWrapper;
  int maxConnectionsSizePerQuery = GlobalRegistry.getInstance().getShardingProperties().<Integer>getValue(ShardingPropertiesConstant.MAX_CONNECTIONS_SIZE_PER_QUERY);
  ShardingExecuteEngine executeEngine = BackendExecutorContext.getInstance().getExecuteEngine();
  sqlExecutePrepareTemplate = new SQLExecutePrepareTemplate(maxConnectionsSizePerQuery);
  sqlExecuteTemplate = new SQLExecuteTemplate(executeEngine, backendConnection.isSerialExecute());
}

origin: apache/incubator-shardingsphere

public JDBCExecuteEngine(final BackendConnection backendConnection, final JDBCExecutorWrapper jdbcExecutorWrapper) {
  this.backendConnection = backendConnection;
  this.jdbcExecutorWrapper = jdbcExecutorWrapper;
  int maxConnectionsSizePerQuery = GlobalRegistry.getInstance().getShardingProperties().<Integer>getValue(ShardingPropertiesConstant.MAX_CONNECTIONS_SIZE_PER_QUERY);
  ShardingExecuteEngine executeEngine = BackendExecutorContext.getInstance().getExecuteEngine();
  sqlExecutePrepareTemplate = new SQLExecutePrepareTemplate(maxConnectionsSizePerQuery);
  sqlExecuteTemplate = new SQLExecuteTemplate(executeEngine, backendConnection.isSerialExecute());
}

origin: apache/incubator-shardingsphere

@SuppressWarnings("unchecked")
protected final <T> List<T> executeCallback(final SQLExecuteCallback<T> executeCallback) throws SQLException {
  return sqlExecuteTemplate.executeGroup((Collection) executeGroups, executeCallback);
}

origin: apache/incubator-shardingsphere

public AbstractStatementExecutor(final int resultSetType, final int resultSetConcurrency, final int resultSetHoldability, final ShardingConnection shardingConnection) {
  this.databaseType = shardingConnection.getShardingContext().getDatabaseType();
  this.resultSetType = resultSetType;
  this.resultSetConcurrency = resultSetConcurrency;
  this.resultSetHoldability = resultSetHoldability;
  this.connection = shardingConnection;
  int maxConnectionsSizePerQuery = connection.getShardingContext().getShardingProperties().<Integer>getValue(ShardingPropertiesConstant.MAX_CONNECTIONS_SIZE_PER_QUERY);
  ShardingExecuteEngine executeEngine = connection.getShardingContext().getExecuteEngine();
  sqlExecutePrepareTemplate = new SQLExecutePrepareTemplate(maxConnectionsSizePerQuery);
  sqlExecuteTemplate = new SQLExecuteTemplate(executeEngine, connection.isSerialExecute());
}

origin: apache/incubator-shardingsphere

@SuppressWarnings("unchecked")
@Override
public ExecuteResponse execute(final SQLRouteResult routeResult) throws SQLException {
  boolean isReturnGeneratedKeys = routeResult.getSqlStatement() instanceof InsertStatement;
  boolean isExceptionThrown = ExecutorExceptionHandler.isExceptionThrown();
  Collection<ShardingExecuteGroup<StatementExecuteUnit>> sqlExecuteGroups =
      sqlExecutePrepareTemplate.getExecuteUnitGroups(routeResult.getRouteUnits(), new ProxyJDBCExecutePrepareCallback(isReturnGeneratedKeys));
  SQLExecuteCallback<ExecuteResponseUnit> firstProxySQLExecuteCallback = new FirstProxyJDBCExecuteCallback(isExceptionThrown, isReturnGeneratedKeys);
  SQLExecuteCallback<ExecuteResponseUnit> proxySQLExecuteCallback = new ProxyJDBCExecuteCallback(isExceptionThrown, isReturnGeneratedKeys);
  Collection<ExecuteResponseUnit> executeResponseUnits = sqlExecuteTemplate.executeGroup((Collection) sqlExecuteGroups,
      firstProxySQLExecuteCallback, proxySQLExecuteCallback);
  ExecuteResponseUnit firstExecuteResponseUnit = executeResponseUnits.iterator().next();
  return firstExecuteResponseUnit instanceof ExecuteQueryResponseUnit
      ? getExecuteQueryResponse(((ExecuteQueryResponseUnit) firstExecuteResponseUnit).getQueryResponsePackets(), executeResponseUnits) : new ExecuteUpdateResponse(executeResponseUnits);
}

origin: apache/incubator-shardingsphere

@SuppressWarnings("unchecked")
@Override
public ExecuteResponse execute(final SQLRouteResult routeResult) throws SQLException {
  boolean isReturnGeneratedKeys = routeResult.getSqlStatement() instanceof InsertStatement;
  boolean isExceptionThrown = ExecutorExceptionHandler.isExceptionThrown();
  Collection<ShardingExecuteGroup<StatementExecuteUnit>> sqlExecuteGroups =
    sqlExecutePrepareTemplate.getExecuteUnitGroups(routeResult.getRouteUnits(), new ProxyJDBCExecutePrepareCallback(isReturnGeneratedKeys));
  SQLExecuteCallback<ExecuteResponseUnit> firstProxySQLExecuteCallback = new FirstProxyJDBCExecuteCallback(isExceptionThrown, isReturnGeneratedKeys);
  SQLExecuteCallback<ExecuteResponseUnit> proxySQLExecuteCallback = new ProxyJDBCExecuteCallback(isExceptionThrown, isReturnGeneratedKeys);
  Collection<ExecuteResponseUnit> executeResponseUnits = sqlExecuteTemplate.executeGroup((Collection) sqlExecuteGroups,
    firstProxySQLExecuteCallback, proxySQLExecuteCallback);
  ExecuteResponseUnit firstExecuteResponseUnit = executeResponseUnits.iterator().next();
  return firstExecuteResponseUnit instanceof ExecuteQueryResponseUnit
    ? getExecuteQueryResponse(((ExecuteQueryResponseUnit) firstExecuteResponseUnit).getPostgreSQLQueryResponsePackets(), executeResponseUnits)
    : new ExecuteUpdateResponse(executeResponseUnits);
}

org.apache.shardingsphere.core.executor.sql.executeSQLExecuteTemplate

Javadoc

SQL execute template.

Most used methods

  • executeGroup
    Execute group.
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now