/** * To make sure SkyWalking will be available at the next release of ShardingSphere, * a new plugin should be provided to SkyWalking project if this API changed. * * @see <a href="https://github.com/apache/skywalking/blob/master/docs/en/guides/Java-Plugin-Development-Guide.md#user-content-plugin-development-guide">Plugin Development Guide</a> * * @param executeCallback execute callback * @param <T> class type of return value * @return result * @throws SQLException SQL exception */ protected List <T> ExecuteCallback <T>(SqlExecuteCallback <T> executeCallback) { List <T> result = SqlExecuteTemplate.Execute(InputGroups, executeCallback); refreshMetaDataIfNeeded(Connection.GetRuntimeContext(), SqlCommandContext); return(result); }
/** * Execute query. * * @return result set list * @throws SQLException SQL exception */ public List <IStreamDataReader> ExecuteQuery() { var isExceptionThrown = ExecutorExceptionHandler.IsThrowException(); SqlExecuteCallback <IStreamDataReader> executeCallback = new SqlExecuteCallback <IStreamDataReader>(DatabaseType, isExceptionThrown); executeCallback.OnSqlExecute += GetQueryEnumerator; return(ExecuteCallback(executeCallback)); }
public int ExecuteNonQuery() { bool isExceptionThrown = ExecutorExceptionHandler.IsThrowException(); var executeCallback = new SqlExecuteCallback <int>(DatabaseType, isExceptionThrown); executeCallback.OnSqlExecute += DoExecuteNonQuery; var callback = ExecuteCallback(executeCallback); return(callback.Sum()); }